Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading url and doing something with it

Status
Not open for further replies.

madref

Programmer
Joined
May 22, 2006
Messages
1
Location
NL
I have maneged to get so far....

Code:
<script type='text/javascript'>[URL=ss]ss[/URL] function Go(){return}</script> 
<script>
// type="text/javascript" src="../Include/Menus/MenuKeuze.js">
// JavaScript Document
function GetURLParam(strParamName) 
{ var strReturn = "";
  var strHref = parent.frames['Frame_Left'].location.href;
  
  
  if ( strHref.indexOf("?") > -1 ) 
  { var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ) 
	{ if ( aQueryString[iParam].indexOf(strParamName + "=") > -1 ) 
	  { var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return strReturn;
} 

if (GetURLParam('Taal') == 'Nederlands') 
 { if (GetURLParam('Menu') == 'Kennel') 
   { document.writeln('<script type="text/javascript" src="../Include/Menus/Menu_Hoofd_Ned.js"></script>');
   };
   if (GetURLParam('Menu') == 'FotoAlbum') 
   { document.writeln('<script type="text/javascript" src="../Include/Menus/Menu_FotoAlbum_Ned.js"></script>');
   };
 };
else if (GetURLParam('Taal') == 'Engels') 
 { document.writeln('<script type="text/javascript" src="../Include/Menus/Menu_Hoofd_Eng.js"></script>');
 }
</script>
<script type="text/javascript" src="../Include/Menus/JavaMenu_Com.js"></script>

What this does is that it calls and creates a menu.
But as you can see i want to call a different menu depending on the url thats been given.

My website has been build in frames (See picture)
Website_Layout.bmp


The problem is that when i call the page in the left frame like : ....Frame_Left.html?Taal=Nederlands&Menu=Kennel
I everytime get the english version of the menu instead of the dutch

What am i doing wrong??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top