【发布时间】:2012-08-29 07:42:39
【问题描述】:
我正在尝试检查用户单击按钮后是否已加载 iframe。
我有
$('#MainPopupIframe').load(function(){
console.log('load the iframe')
//the console won't show anything even if the iframe is loaded.
})
HTML
<button id='click'>click me</button>
//the iframe is created after the user clicks the button.
<iframe id='MainPopupIframe' src='http://...' />...</iframe>
有什么建议吗?
顺便说一下,我的 iframe 是动态创建的。它不会在初始页面加载时加载。
【问题讨论】:
标签: javascript jquery html iframe