Estoy tratando de verificar si un iframe se ha cargado después de que el usuario haga clic en un botón.¿Cómo puedo detectar si un iframe está cargado?
que he
$('#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>
¿Alguna sugerencia?
Por cierto, mi iframe se crea dinámicamente. No carga con la carga de la página inicial.
[Haga clic] (http://stackoverflow.com/questions/205087/jquery-ready-in-a-dynamically-inserted-iframe) –