PDA

View Full Version : using OnLoad and Iframes


isubeatle
08-06-2003, 03:15 PM
On my page i have three Iframes and what i'm looking for is the following:

when i click on a link the main Iframe loads and i need two other Iframes to load as well. now i need some script that will tell the page not to load the 2nd and 3rd frames until after the 1st frame is loaded. the reason is because the 1st frame is the main content and the 2nd and 3rd frames are for ads. so i don't want people to have to wait for the ads to load while they're waiting for the content to load.

i think that i would need to use on OnLoad function for this behavior, but i'm not for sure. if anyone can help that would be great. thanks
Shawn

Vincent Puglia
08-06-2003, 05:25 PM
Hi,

Is this what you mean?

<script language="javascript">

function doit()
{
frames.a.location='http://members.aol.com/grassblad'
frames.b.location="http://members.aol.com/grassblad/html/chkAllBut.html"
frames.c.location='http://members.aol.com/grassblad/dHTML/dHTML3.html'
}
</script>
<body onload='doit()'>
<iframe style="width: 400; height 200px;" name='a'> </iframe>
<iframe style="width: 400; height 200px;" name='b'></iframe>
<iframe style="width: 400; height 200px;" name='c'></iframe>
</body>

Vinny

isubeatle
08-06-2003, 06:25 PM
hey Vinny

that's close to what i need, but what's happening is that there are now three frames above the 1st, or main frame. the three Iframe calls are in two different files. the 1st frame is in a slideshow.jhtml file that has all kinds of params and such. the 2nd and 3rd frames are in an over all shell.jhtml file that has a call in the page body for the slideshow.jhtml file.

so would the body script go in the shell.jhtml, or template i guess, or would it go in the slideshow.jhtml?

and i know this seems confusing, but i have so much code that it would be impossible to add it all. thanks a lot!

Shawn

isubeatle
08-06-2003, 09:27 PM
just incase anybody cares, this is how someonehelped me to fix the problem.

<body onload="parent.framename1.location.href='www.website.com';parent.framename2.location.href='www.website.com';">

that's it