What I need is a way to change src of iFrame with
javascript fuction.
Here is what is have:
<iframe name="ifr_name" src="file_1.htm">
</iframe>
If I call this function:
function getSrc(){
alert(document.admin_tools.src);
}
I get "undefined".
If I call this function:
function getName(){
alert(document.admin_tools.src);
}
I get "admin_tools"
Why?
If I call this function:
unction setSrc(){
document.admin_tools.src="file2.cfm";
}
nothing happens.
Please, help.
document.all.ifr_name.src
or: document.getElementsByName("ifr_name")[0].src //if the name is unique
or: document.getElementsByTagName("IFRAME")[0].src //for the 1st iframe
mfg
Christoph