BrianMerkel
06-28-2006, 11:51 AM
Hello, I am using the following code to extract the x value of the query string.
----------------------
<head>
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
alert('Query Variable ' + variable + ' not found');
}
</script>
</head>
<body>
<script>
alert( getQueryVariable("x") );
</script>
-----------------
What i need to do is make it so that i can place the extracted querystring info and use it in this:
document.getElementById ("NameOfDIV").innerHTML = WHAT DO I PUT HERE?
Unfortuantly I do not know what to make the inner.HTML equal to to display the query string.
IF anyone can help, that would be great.
Thank you,
-Brian
----------------------
<head>
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
alert('Query Variable ' + variable + ' not found');
}
</script>
</head>
<body>
<script>
alert( getQueryVariable("x") );
</script>
-----------------
What i need to do is make it so that i can place the extracted querystring info and use it in this:
document.getElementById ("NameOfDIV").innerHTML = WHAT DO I PUT HERE?
Unfortuantly I do not know what to make the inner.HTML equal to to display the query string.
IF anyone can help, that would be great.
Thank you,
-Brian