[thelist] JavaScript and GET name value pairs

Roger Ly rogerly at bareviking.com
Wed Dec 18 12:12:01 CST 2002


Hey Tom,

Try this:

function GetQueryString(strLocation) {
	var strURL = strLocation.toString();
	var qIndex = strURL.indexOf('?');
	if (qIndex == -1) {
		return "";
	} else {
		return strURL.substring(qIndex + 1);
	}
}

var strQueryString = GetQueryString(document.location);

You can then take strQueryString and split it up into name/value
pairs...

Roger




More information about the thelist mailing list