Q
Quarco
Next challenge..
How to execute a function on 'load' of (dynamically created) iframe..
E.g: alert the title of loaded document....
Tried this:
var frms =
document.getElementById('container').getElementsByTagName('iframe');
for(var i=0; i<frms.length; i++) {
frms.addEventListener("load", function() {
alert(frms.contentWindow.content.title);}, false);
}
This doesn't work.... :-(
Next 'solution' only alerts initial loaded page title:
var iFrames =
top.document.getElementById('container').getElementsByTagName('iframe');
for(var i=0; i<iFrames.length; i++) {
(function(monkey) {
iFrames.addEventListener('load', function(e) {
alert(this.src);
}, false);
})(iFrames);
}
Hope someone can help me out )))
Thanx in advance anyway..
Marco
How to execute a function on 'load' of (dynamically created) iframe..
E.g: alert the title of loaded document....
Tried this:
var frms =
document.getElementById('container').getElementsByTagName('iframe');
for(var i=0; i<frms.length; i++) {
frms.addEventListener("load", function() {
alert(frms.contentWindow.content.title);}, false);
}
This doesn't work.... :-(
Next 'solution' only alerts initial loaded page title:
var iFrames =
top.document.getElementById('container').getElementsByTagName('iframe');
for(var i=0; i<iFrames.length; i++) {
(function(monkey) {
iFrames.addEventListener('load', function(e) {
alert(this.src);
}, false);
})(iFrames);
}
Hope someone can help me out )))
Thanx in advance anyway..
Marco