• Resolved samverlen

    (@samverlen)


    Hello,

    I have an issue with the reload code for FB & Twitter widgets on my WP pages. Indeed, it well works the first time (on the reload of the first page) but it does not work anymore on clicking on the next pages of the menu.
    Here is the reload source code :
    // For Twitter widget
    (function(d,s,id)
    {
    var js,fjs=d.getElementsByTagName(s)[0];
    if(!d.getElementById(id))
    {
    js=d.createElement(s);
    js.id=id;
    js.src=”//platform.twitter.com/widgets.js”;
    fjs.parentNode.insertBefore(js,fjs);
    }
    }
    (document,”script”,”twitter-wjs”));

    // For FB widget
    (function(d, s, id)
    {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id))
    return;
    js = d.createElement(s);
    js.id = id;
    js.src = “//connect.facebook.net/fr_FR/all.js#xfbml=1&appId=148447561848324”;
    fjs.parentNode.insertBefore(js, fjs);
    }
    (document, ‘script’, ‘facebook-jssdk’));

    And here is the web site current link : https://lebelaccident.free.fr/new

    Thanks for your help !

    https://www.ads-software.com/extend/plugins/advanced-ajax-page-loader/

Viewing 3 replies - 1 through 3 (of 3 total)
  • simply add this little snippet into your footer and it’ll work

    <script>
    jQuery('#content').ajaxComplete(function(){
    FB.XFBML.parse();
    twttr.widgets.load();
    });
    </script>

    you don’t need to add the other code into the reload.js

    Plugin Author Dean Williams

    (@deano1987)

    or instead of adding it into the footer, add this as a reload code:

    FB.XFBML.parse();
    twttr.widgets.load();
    Thread Starter samverlen

    (@samverlen)

    Thanks for your help, it works now !

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Reload code only works the first time’ is closed to new replies.