Click to See Complete Forum and Search --> : how to control Iframe.src.....


guxudong
11-23-2003, 03:07 AM
there is a iframe in main html
how to how to control the Iframe.src
>function link(url)
{
document.frames.ID.location=url
}

.....
<html>
...
<iframe name=ID src=xxx.asp>
</iframe>
...
</html>

is it ok???
how to write link(url) event
I write is right?

ray326
11-23-2003, 12:45 PM
You have to give the iframe an id and use document.getElementById("myframe") to access it.

function link(newurl)
{
document.getElementById("myframe").src= newurl;
}

And in your html:

<iframe id="myframe" src="xxx.asp">
</iframe>