iframe onLoad
I have this iFrame, that when it loads, changes the page, etc.. called the testLoader() function, which for now is only an alert box.
<iframe src="about:blank" onLoad="testLoader();"></iframe>
The issue is that when I on the fly create the iFrame, the onLoad function doesn't trigger the testLoader function.. I have changed the page of the iframe in hopes of getting the alert but to no avail.
function createIframe(id,app)
{
//method 1
nIframe = document.createElement("iframe");
nIframe.id = id
nIframe.attachEvent('onLoad',app);
document.body.appendChild(nIframe);
//method 2
nIframe = document.createElement("<iframe id='" + id + "' onLoad='" + app + "'></iframe>");
document.body.appendChild(nIframe);
}
If anyone has any idea, please let me know...
|