我在我的页面上加载了一个iframe。iframe的内容仅在页面上加载了其余内容之后才加载。是否可以在主页上加载其他内容之前加载iframe中的内容?
谢谢
发布于 2014-10-07 00:59:14
试一试
// hold `ready` event
$.holdReady(true);
var frame = $("<iframe>");
$(frame).load(function(e) {
// release `ready` event
$.holdReady(false)
});
// append `frame` to document
$("body").append(frame);
$(document).ready(function() {
// do stuff
// after `frame` loaded
$("body").append("done")
});jsfiddle http://jsfiddle.net/guest271314/x7ptnbjy/
请参阅jQuery.holdReady()
https://stackoverflow.com/questions/26218354
复制相似问题