Addthis not working with Ajax

后端 未结 9 1898
广开言路
广开言路 2021-02-07 14:38

I am loading all articles with Ajax but Addthis functionality is not correct

 $thisChild.load( permLink + \' #thePostStuff\', function() {

And

相关标签:
9条回答
  • 2021-02-07 15:39

    I read this support post the other day, it might have to do with your problem: http://support.addthis.com/customer/portal/questions/240144-email-template-when-using-ajax-bug-?t=89322

    If I understand it correctly he describes that after the first share, the widget gets disconnected from your profile and every future share (without refresh) does not get tracked or anything. his solution was declaring the pubid separately. I have no idea if this helps at all, but I thought it wouldn't hurt to show you what I found on the subject :)

    0 讨论(0)
  • 2021-02-07 15:42

    Problem is that on a ajax call the #pubid is getting lost so AddThis doesn't know who is making the call.

    This worked for me:

    <script>
    $.getScript("https://s7.addthis.com/js/300/addthis_widget.js#pubid=YOUR-ID", function () {
        addthis_config = { pubid: 'YOUR-ID' };
        addthis.init();
    });
    </script>
    

    Found the answer to this issue on the support site of addthis.com: http://support.addthis.com/customer/portal/questions/240144-email-template-when-using-ajax-bug-?t=89322

    0 讨论(0)
  • 2021-02-07 15:43
    addthis.toolbox(".addthis_toolbox");
    
    0 讨论(0)
提交回复
热议问题