最佳答案
我试图检查一个 iframe 是否已经加载后,用户点击一个按钮。
是的
$('#MainPopupIframe').load(function(){
console.log('load the iframe')
//the console won't show anything even if the iframe is loaded.
})
超文本标示语言
<button id='click'>click me</button>
//the iframe is created after the user clicks the button.
<iframe id='MainPopupIframe' src='http://...' />...</iframe>
有什么建议吗?
顺便说一下,我的 iframe 是动态创建的,它不用初始页面加载。