Forum Moderators: open

Message Too Old, No Replies

iframes

controlling iframes

         

radu81

8:43 am on Jul 16, 2003 (gmt 0)

10+ Year Member



hi. i have a problem with iframes. I want to load a page on a iframe, but the page is loaded on a new page, and not in the iframe.this is my function. pls help me

function azienda()
{
document.write("<iframe name='ifr' src='C:/Documents and Settings/Stefano/Documenti/Web/radu/index_anc/azienda_anc.htm' width=510 height=260 scrolling=no frameborder=0>");
document.write("</iframe>");
document.write("<a href='index.htm'></a>");
}

ncsuk

8:58 am on Jul 16, 2003 (gmt 0)

10+ Year Member



Why dont you just put

<iframe name='ifr' src='C:/Documents and Settings/Stefano/Documenti/Web/radu/index_anc/azienda_anc.htm' width=510 height=260 scrolling=no frameborder=0>
</iframe>

in the page and not in a function surely that would work. Either that or I have misunderstood your query completly and need some more of an explanation.

radu81

9:10 am on Jul 16, 2003 (gmt 0)

10+ Year Member



becouse i am calling that function with onmouseover

Iguana

9:45 am on Jul 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



By using document.write after the page has loaded you are overwriting the current document

try adding a spacer such as <div id="boo"></div>

and then

document.all("boo").innerHTML = "<iframe name='ifr' width=510 height=260 scrolling=no frameborder=0></iframe>";

document.all("ifr").contentWindow.document.location = "temp.asp"

By the way - this cose is specific to IE 6 and 5.5
- NS6 uses .contentDocument and IE5 uses .document instead of .contentWindow.document

radu81

1:11 pm on Jul 16, 2003 (gmt 0)

10+ Year Member



thanks Iguana! it's working