E
Eli
Hi,
I've created a dynamic IFRAME and inserted it in the document. Then I
changed the src property to some URL (not the same domain as the main
document). I want to check when the IFRAME is loaded and then get its
title to put in the main document.
function GetTitle()
{
var
ifr_title=document.getElementById('myiframe').contentWindow.document.title;
alert('The IFRAME was loaded and its title is:\n'+ifr_title);
}
var ifr=document.createElement('IFRAME');
ifr.id='myiframe';
ifr.style.width='100%';
ifr.style.height='100%';
ifr.src='http://www.php.net';
ifr.onload=GetTitle;
document.appendChild(ifr);
But it seems that the GetTitle() function is never called, tho the
IFRAME was loaded. How can I make this work?
-thanks, Eli
I've created a dynamic IFRAME and inserted it in the document. Then I
changed the src property to some URL (not the same domain as the main
document). I want to check when the IFRAME is loaded and then get its
title to put in the main document.
function GetTitle()
{
var
ifr_title=document.getElementById('myiframe').contentWindow.document.title;
alert('The IFRAME was loaded and its title is:\n'+ifr_title);
}
var ifr=document.createElement('IFRAME');
ifr.id='myiframe';
ifr.style.width='100%';
ifr.style.height='100%';
ifr.src='http://www.php.net';
ifr.onload=GetTitle;
document.appendChild(ifr);
But it seems that the GetTitle() function is never called, tho the
IFRAME was loaded. How can I make this work?
-thanks, Eli