开发者

Jquery. Execute code only when all iframes are loaded

开发者 https://www.devze.com 2023-01-13 16:56 出处:网络
$(document).ready(handler) call to handler when page is lo开发者_如何学Caded not paying attention to whether iframes\' content is loaded or not. I want code to be executed only when content of all if

$(document).ready(handler)

call to handler when page is lo开发者_如何学Caded not paying attention to whether iframes' content is loaded or not. I want code to be executed only when content of all iframes loaded.

Is there any way to achieve this?


This may help solve your problem:

jQuery .ready in a dynamically inserted iframe


Use the .load() function to attach a callback to run when the iframe is loaded.

$('iframe.frame').load(function(){
    // do something...
});
0

精彩评论

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