Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iframe + reference

Status
Not open for further replies.

vlitim

Programmer
Sep 2, 2000
393
GB
I have the code below where I want to be able to load a page into an iframe by passing its name and url, but I can't quite figure out how to reference the iframe once the name has been passed to the function???

<script language=javascript>

function loadFrame(framename,url)
{
window.framename.location.href=url
}
</script>

<iFRAME name=listsiteVisits frameborder=0 scrolling=yes marginheight=0 marginwidth=1 width=100% height=100></iFRAME>

<a href=# onclick=&quot;loadFrame('listsiteVisits','test.asp')&quot;>load</a>

Cheers
Tim
 
Hi vlitim,

Use :

window.frames[framename]

Hope this helps ...
 
function loadFrame(framename,url)
{
window.listsiteVisits.location.href=url
}


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top