javascript - How to reload script after ajax call? - Stack Overflow

I'm using infinite scroll and social share buttons after loading more results aren't appearin

I'm using infinite scroll and social share buttons after loading more results aren't appearing. I need to reload the script for the buttons to appear? I'm using the add to any plugin and they script is <script type="text/javascript" src=".js"> </script> How do i reload this script so that the buttons appear? I added this code but only the facebook and twitter buttons appeared after ajax loaded new results not the google plus and pinterest...

jQuery('body').trigger( 'post-load');

How do i solve this?

I'm using infinite scroll and social share buttons after loading more results aren't appearing. I need to reload the script for the buttons to appear? I'm using the add to any plugin and they script is <script type="text/javascript" src="http://static.addtoany./menu/page.js"> </script> How do i reload this script so that the buttons appear? I added this code but only the facebook and twitter buttons appeared after ajax loaded new results not the google plus and pinterest...

jQuery('body').trigger( 'post-load');

How do i solve this?

Share Improve this question asked Feb 19, 2015 at 11:40 user892134user892134 3,21419 gold badges68 silver badges140 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

You can use the .ajaxComplete(function().

$( document ).ajaxComplete(function() {
  $( ".log" ).text( "Triggered ajaxComplete handler." );
});

See more here.

Or you can use the jQuery.GetScript()

$.getScript( "ajax/test.js" )
  .done(function( script, textStatus ) {
    console.log( textStatus );
  })
  .fail(function( jqxhr, settings, exception ) {
    $( "div.log" ).text( "Triggered ajaxError handler." );
});

See more here.

$( document ).ajaxComplete(function() {
 a2a.dom.ready(function(){a2a.init_all();a()});
});

or

 $( document ).ajaxComplete(function() {
    if(document.body){a2a.init();a()} a2a.dom.ready(function(){a2a.init_all();a()});
 });

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744946662a4602661.html

相关推荐

  • javascript - How to reload script after ajax call? - Stack Overflow

    I'm using infinite scroll and social share buttons after loading more results aren't appearin

    1天前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信