by Jim
Jan 30, 2007 2:38 PM
This shouldn't be so hard to google. To parse an html page's query string with Javascript, using a regular expression:
// Get the value of one of the arguments in the query string
function getFieldValue(name)
{
var match = (new RegExp('[?&;]' + name + '=([^&;#]*)')).exec(location.search);
return match ? unescape(match[1]) : "";
}
Returns an empty string if the name doesn't match.