Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting when an IFRAME receives a src
Message
From
05/05/2010 02:57:17
 
 
To
05/05/2010 01:50:48
General information
Forum:
Internet
Category:
DHTML
Miscellaneous
Thread ID:
01463159
Message ID:
01463162
Views:
27
I tried this code but only the load event works. The documentation says that the onunload should work as well but this doesn't work.
addEvent(document.getElementById("IFrameGeneric"),"load",function(){ Test() })
addEvent(document.getElementById("IFrameGeneric"),"unload",function(){ Test2() })

function addEvent(object,type,handler){
	if(object.addEventListener){
		object.addEventListener(type,handler,false);
	}
	else{
		object.attachEvent("on"+type,handler);
	}
}

function Test()
{
   alert("test")
}

function Test2()
{
   alert("test2")
}
Can someone confirm that only the load event works? To test, you would need to create a page with an IFrame named IFrameGeneric. Then, have some javascript code that will change document.getElementById("IFrameGeneric").src to something. You will see that an alert test will be shown once the load event completes. But, the documentation says that the onunload event should be supported as well. That one is suppose to kick in once we change the .src value.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform