开发者

Jquery async setup

I have a php scr开发者_运维技巧ipt which when fired, collects some data on different sites using an AJAX call in jquery, and displays the results in a Div.

I also have a lightbox plugin which needs to be reinitialised after the result of the ajax call has loaded. To enable this, I've turned async off ($.ajaxSetup({async:false});) so it doesnt load before the results div has finished loading.

This works fine, except for in Chrome (and I would assume IE) where the 'loading' image is not displayed when this setting is in use.

Is there a smart way around this?


you can still do it asynchronously, just do your initialisation inside the success callback function:

$.ajax({
    url:'',
    data:'',
    success:function(response){
        // init your lightbox here
    }
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜