Using the following URL and code I get always the 'message' that firstname = undefined
my url equals : file:///H:/test2.html?concert=ACDC
my code
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs.split('=');
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
params = getParams();
</script>
<TITLE>test2</TITLE>
</HEAD>
<Body>
<SCRIPT LANGUAGE="JavaScript">
firstname = unescape(params["concert"]);
document.write("firstname = " + firstname + "<br>");
</script>
</body>
</HTML>
Thanks for your help
Geert
my url equals : file:///H:/test2.html?concert=ACDC
my code
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs.split('=');
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
params = getParams();
</script>
<TITLE>test2</TITLE>
</HEAD>
<Body>
<SCRIPT LANGUAGE="JavaScript">
firstname = unescape(params["concert"]);
document.write("firstname = " + firstname + "<br>");
</script>
</body>
</HTML>
Thanks for your help
Geert