Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting when an IFRAME receives a src
Message
De
05/05/2010 02:57:17
 
 
À
05/05/2010 01:50:48
Information générale
Forum:
Internet
Catégorie:
DHTML
Divers
Thread ID:
01463159
Message ID:
01463162
Vues:
25
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform