PDA

View Full Version : URL to automatically load with a frame


tcollick
02-05-2003, 07:21 AM
Hi,

Im a newbie so this is probably very easy!...
I need a code so another URL automatically loads within
a frame on my website. Help please!

regards,

TC

Mhtml
02-05-2003, 09:14 AM
Make sure that your frame has a name. Then in your links just include target="FrameNameHere" .

So as an example, if your frame was called MainFrame you would have your link like this...

<a href="thispage.html" target="MainFrame">Go to this page!</a>

tcollick
02-05-2003, 09:21 AM
Thanks Mhtml,

Could you tell me how to do that without the link...
I need it to be automatic...maybe I need to use "onload" ?

regards,

TC

Mhtml
02-05-2003, 09:30 AM
Oh right, lol sorry didn't read you question right. :o

Well in your frame (be it an iFrame or frameset frame) just add src="yourpage.html"

OR, are you wanting it so that it will load another frame other than the one already loaded?

In that case I think something like,

document.myFrame.location="yourpage.html";


Would work.

tcollick
02-05-2003, 09:47 AM
Thanks...but i cant get it to work
do I need to use the "<body onload ="????()"> for this?

Mhtml
02-05-2003, 10:02 AM
body onLoad will execute a javascript script.

Ok, show me the code you have and I will try to guide you through it with examples.

Mhtml
02-05-2003, 10:04 AM
hmm.. posted @ the same time.