Click to See Complete Forum and Search --> : Passing URL Variables


Force
09-09-2003, 04:38 PM
I've using the following script to parse variables being received by the page, and then I want to append them to the redirect. I can't quite seem to get the variable url to append properly. Can anyone give me an assist? I think that I'm all around it.
Again, thanks for the help

Mark

<script language="JavaScript">
function urlconvert(){
var qs = location.search.substring(1);
var nv = qs.split('&');
var url = new Object();
for(i = 0; i < nv.length; i++)
{
eq = nv[i].indexOf('=');
url[nv[i].substring(0,eq).toLowerCase()] = unescape(nv[i].substring(eq + 1));
}
window.location="https://www.myserver.com/index.html?+url";
}

</script>

Xin
09-09-2003, 05:22 PM
window.location="https://www.myserver.com/index.html?"+url;

Force
09-10-2003, 11:15 AM
Zin,

I tried that one and got the result:

https://www.myserver.com/receipt.cfm?[object%20Object]

in the URL of the final template.

I ran a check and the URL parameters are getting to the link page just fine, so I'm guessing that something is wrong with my code.
Do you see anything else that I may be doing wrong?
Thanks.

Mark

requestcode
09-10-2003, 11:42 AM
Or try:
window.location="https://www.myserver.com/index.html?"+qs;

Xin
09-10-2003, 12:18 PM
window.location="https://www.myserver.com/index.html?"+unescape(qs);

Force
09-11-2003, 01:54 PM
Thanks to both. I've got it working now. Again, thanks for the help.

Mark F.