0
我该如何做?jquery:在创建iframe DOM对象后绑定LOAD事件
$('#divToInsert').html('<iframe id="outputPage" src="/Folder/webpage.aspx" width="90%" height="600" frameborder="0" scrolling="yes" style="overflow-x: hidden"><p>WARNING: Your browser does not support iframes. Please contact your adminstrator for assistance.</iframe>');
$('#outputPage').unbind('load');
$('#outputPage').bind('load', function() {
alert('done!');
});
类型0#2。抱歉。仍然不起作用。 – 2011-02-25 00:55:09
@Martin:DOM是否加载?我在回答中发布了一个jsFiddle示例。你的代码有效。确保'divToInsert' ID也是正确的。 – user113716 2011-02-25 00:58:31
它工作在Mozilla中,而不是在IE 8中。 – 2011-02-25 00:59:38