Facebook和twitter的分享数没有更新

facebook and twitter share count not updating on share

本文关键字:更新 分享 twitter Facebook      更新时间:2023-09-26

问题是facebook和twitter计数不更新共享。它在页面刷新时更新。是否可以在facebook和twitter墙上成功分享时显示更新的计数而不刷新页面?

我使用下面的代码

<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>

和我使用ajax显示更多的博客

$.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');
                }
            });

我使用" fb . xfbm .parse();"answers"twttr.widgets.load();"函数来显示从ajax加载的文章的fb和twitter计数

Thanks in advance

使用Ajax。Ajax将刷新页面中的特定部分,而不是整个页面。