Addthis not working with Ajax

后端 未结 9 1900
广开言路
广开言路 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:38

    I wrote a pretty detailed description here https://stackoverflow.com/a/16950881/1118070 but, the gist is that addthis.toolbox(".addthis_toolbox"); is the correct solution, but it's important to note that it should be called each time the new ajax content is loaded.

    html

     

    javascript

    // onload of the ajax content
    addthis.toolbox('.addthis_toolbox'); 
    

    Also note that anything that loads as an iframe such as the facebook like counter, it will cause problems if it is nested within a '.addthis_toolbox' container. I'd suggest putting it inside it's own container and calling the toolbox() method on them both.

    See my link for more details.

提交回复
热议问题