Javascript: Check if iframe is loaded








var iframe = document.createElement("iframe");
iframe.src = "http://notepad2.blogspot.com/";

if (iframe.attachEvent){
iframe.attachEvent("onload", function(){
alert("Local iframe is now loaded.");
});
} else {
iframe.onload = function(){
alert("Local iframe is now loaded.");
};
}

document.body.appendChild(iframe);

See Also: iframe, onload and document.domain


No comments:

Post a Comment