javascript - How do you add a counter to the Facebook share button (generated via FB.ui)? -
this how i'm generating share button:
<a href="#" class="share-btn">share facebook</a> <script type="text/javascript"> function fb_share() { var fbmsg = $('.lesson_lt_share_popup').text().trim() fb.ui( { method: 'feed', name: "chinese learn online | progressive mandarin course", link: "http://www.chineselearnonline.com/level-test/", picture: "http://www.chineselearnonline.com/wp-content/themes/clo/assets/img/images/clo-fb-white.png", description: fbmsg }, function(response) { // nothing }); } // add click event link using jquery $(document).ready(function(){ $('.share-btn').on( 'click', fb_share ); });
but count find generating counter in official docs.
how do that?
generating counter manually pain, have read count graph api. easiest solution use official share button plugin instead of fb.ui
, includes counter already: https://developers.facebook.com/docs/plugins/share-button
it takes neccessary data open graph tags.
btw, feed dialog deprecated.
Comments
Post a Comment