View Full Version : Passing a URL to Iframes

09-27-2002, 08:24 PM
Does anyone now of a way to pass a new URL to an IFrame via another pages onLoad event?

09-27-2002, 11:04 PM
sort of depends where the iframe is in relation to the onload page. Just follow the window heirarchy backwards to the top document of the iframe holding page and then downwards to the iframe -- eg

window.opener.top.frames[3].iframename.location.href = "newpage.htm";

09-27-2002, 11:22 PM
I actually just figured out what I was trying to do. It got a little long winded but it works.

<Body onLoad="top.frames['Framename'].document.iFrameName.location.href='URL';">