• I’m using this plugin and it works great.
    Now I tried to add AJAX loading of the posts on the front page.
    And the html is there, but the JS does not seem to have time to process the the content. And I get either one button out of three or more often nothing.

    Can someone suggest the way to make sure that the content is processed by this plugin JS when loading posts with AJAX?

    Thanks!

    https://www.ads-software.com/plugins/social-sharing-toolkit/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter RomSocial

    (@romsocial)

    I got it to display twitter and g+ buttons by including the scripts a the end of php loader, but facebook still does not appear…
    Any tips?

    <script type='text/javascript' src='/wp-content/plugins/social-sharing-toolkit/script_no_follow_2.1.2.js'></script>
    <script type='text/javascript' src='/wp-content/plugins/social-sharing-toolkit/includes/buttons/button.googleplus.js'></script>
    <script type='text/javascript' src='https://platform.twitter.com/widgets.js'></script>
    <script type='text/javascript' src='/wp-content/plugins/social-sharing-toolkit/includes/buttons/button.facebook.js'></script>
    <script type='text/javascript' src='https://connect.facebook.net/en_US/all.js?#xfbml=1'></script>

    Hello,
    I got this working by adding the following functions to the ajax loading js file.

    $(document).ajaxComplete(function() {
        FB.XFBML.parse(); // For Facebook button.
        twttr.widgets.load(); // For Twitter button.
        gapi.plusone.go(); // For Google plus button.
    });

    The ajaxComplete method is not necessary just add the function after ajax load.
    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Applying for Ajax loaded posts.’ is closed to new replies.