Click to See Complete Forum and Search --> : Loading Two Frames


AngelKane
12-09-2002, 08:29 AM
I have a webpage which is currently table-based. I'd like to switch it to frames, but I have a problem. My page has both a main menu, and sub-menus, and I'd like to be able to load both the sub-menu and a main page for the subsection by clicking on a link in the main menu. Does anybody have any suggestions which might help? I'm the ultimate newbie when it comes to javascript, so please keep it simple. Thanks! :confused:

AdamGundry
12-09-2002, 10:59 AM
You need to name/id your frames in the top-level page, then you can refer to them like this:

<a href="javascript:window.top.frame1.location = 'page1.html';window.top.frame2.location = 'page2.html';">

This changes frame1's location to page1, and frame2's to page2. You may need to add levels to the hierachy if you are using nested framesets.

Hope this helps

Adam

P.S. It's better to avoid frames and JavaScript like this if you can, because it can make pages awkward for some users.