This might help:
function getQueryValue(firstName) { var qstring = window.location.search, qstringArray = qstring && qstring.substring(1).split("&"), i = 0, len = qstringArray.length; for (; i < len; i++) { var token = qstringArray[i], eqIndex = token.indexOf("="), firstPart = token && token.substring(0, eqIndex); if (firstPart === param ) { return token.substring(eqIndex + 1, token.length); } } }
E.g. Given a URL “http://domain.com?firstName=Jeff” , you can call this function as getQueryValue(“firstName”) and you'll get “Jeff”