Click to See Complete Forum and Search --> : Need to determine what file is loaded


glenn
01-05-2003, 03:29 PM
Hi,
It feels like I'm going around in circles and hope there's someone here who can help me out.

I have a site with a frameset (menu and main) and fly out menus in the menu frame that "fly out" in the main frame.

I need to determine what file is loaded in the menu frame in order to call the correct menu script.

In my head I have a vision of how it would look but I'm so new to javascript I don't know how to code it correctly. Here is my "vision" of the script to put on the pages loaded in the main frame:

function whichMenuIsLoaded() {

if (parent.menu="menu1.html") then
mmLoadMenusA();
else
mmLoadMenusB();
}

Would be really happy for any hints on this matter.

Thanks
Glenn

ShrineDesigns
01-05-2003, 05:34 PM
if you are try to get the url of the page to determine what is display; use the "location" attribute

example:
<script language="JavaScript">
<!--
function whichMenuIsLoaded(){
if (parent.menu.location="http://www.mysite.com/menu1.html"){
mmLoadMenusA();
}else{
mmLoadMenusB();
}
}
//-->
</script>

glenn
01-06-2003, 09:40 AM
Thank you very much for helping me out!! It works perfectly and has really made my day :)

Warm regards
Glenn