GetQueryString function
March 19, 2009 12:00 AM
So something like this:function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("="); if (vars[1] == "en"){ }else if (vars[1] == "fr"){ }else if (vars[1] == "sp"){ }} What this function does, is take the string after the '?'and then parse it out into and array everytime there is an "=" sign. So you end up getting an array that looks like this:0: Language1: enYou can then compare this value in the array to "en" using your if statements to properly execute the code.
Discussions have been disabled for this post