javascript - facebook and twitter share count not updating on share -
the problem facebook , twitter count not updating on share. updating on page refresh. possible display updated count without page refresh on successful share on facebook , twitter wall.
i using following code
<div class="fb-share-button" data-href="<?php echo $domainurl;?>/en/blog-view.php?bid=<?php echo $bid;?>" data-type="button_count"></div> <a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php echo $domainurl;?>/en/blog-view.php?bid=<?php echo $blogres['blog_id'];?>">tweet</a>
and use ajax display more blogs
$.ajax({ url: 'get_blogs.php', type: 'post', data: datastring, cache: false, success: function(html){ $('#loading').hide(); $('#bloglist').append(html); fb.xfbml.parse(); twttr.widgets.load(); var nextpage=parseint(loadid)+1; if(nextpage<=totalpages){ $("#load_more").val(nextpage); }else{ $("#load_more").val('0'); } $("#process_page").val('0'); } });
i use "fb.xfbml.parse();" , "twttr.widgets.load();" functions displaying of fb , twitter counts articles loaded ajax
thanks in advance
use ajax. ajax refresh particular part in page instead of whole page.
Comments
Post a Comment