开发者

Refire certain scripts after jQuery AJAX load

开发者 https://www.devze.com 2022-12-11 02:18 出处:网络
I need 开发者_如何学JAVAcertain scripts to refire after an AJAX load. How could I accomplish this?You could use the success callback to invoke the functions you want to refire.

I need 开发者_如何学JAVAcertain scripts to refire after an AJAX load. How could I accomplish this?


You could use the success callback to invoke the functions you want to refire.

$.ajax({
    url: '/url',
    success: function() {
        func1();
        func2();
    }
});


If you just need to reattach events try the live method.


Use the callback function

A callback is a plain JavaScript function passed to some method as an argument or option. Some callbacks are just events, called to give the user a chance to react when a certain state is triggered. jQuery's event system uses such callbacks everywhere:

More info here

0

精彩评论

暂无评论...
验证码 换一张
取 消