Addthis not working with Ajax

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

    After 1 hour of trying custom codes i found this one that works perfect.

    $(document).ajaxStop(function() {
      if (window.addthis) {
        window.addthis = null;
        window._adr = null;
        window._atc = null;
        window._atd = null;
        window._ate = null;
        window._atr = null;
        window._atw = null;
      }
      return $.getScript("http://s7.addthis.com/js/300/addthis_widget.js#pubid=sdive");
    });
    

    This is the source

提交回复
热议问题