Click to See Complete Forum and Search --> : Keeping in a frame


jake_604
08-21-2003, 08:43 AM
I have a piece of JavaScript that I use on all my pages, which redirects to the main frame:


<SCRIPT>
if (parent.frames.length==0)
window.location.replace("mainframe.html")
</SCRIPT>


Is it possible to add something to that, or have another piece of JavaScript that redirects to the main frame, but displays the page the user wanted to view.

Eg, I type in the address bar pictures.html which has the above script in. The browser then redirects to mainframe.html, but loads the pictures page in the frame.

If you get what I mean.

:confused:

Khalid Ali
08-21-2003, 09:27 AM
you can pass the requested url to the main age and then parse the url and re create the secondary url and load the child frame as follows

parent.childFrameName.location.href = parsedURL;

jake_604
08-21-2003, 10:14 AM
Im not very technical, so im sorry, but can you explain it a bit more??

Thanks

:) :)

Namuna
08-23-2003, 12:26 PM
I'd like to have more detail on this too, please.

pyro
08-23-2003, 12:50 PM
Take a look at this: http://www.webdevfaqs.com/javascript.php#forceframeset

jake_604
08-23-2003, 12:54 PM
Thanks a lot pyro!

pyro
08-23-2003, 01:24 PM
You are very welcome... :)