PDA

View Full Version : URL variables & strings


ubik
11-02-2005, 10:21 PM
Hello, Good Day,

I was wondering if someone would be so kind as to help me out in understanding a few things about sending a variable through a URL..

firstly:
i have two pages on page1.html i have a link which is:

window.location = "page2.html?name=yournamehere";

on page2.html how how would i be able to access the variable "name" ?

i know the following code works for strings, but i want to be able to directly access the variable that has already been assigned a value.

function parse(){
var Loc=this.location.toString();
var URLarray1=Loc.split('?')[1];
}

Lerura
11-02-2005, 10:41 PM
var URLarray1=eval(Loc.split('?')[1]);

ubik
11-02-2005, 11:00 PM
var URLarray1=eval(Loc.split('?')[1]);


thank you very much, i really appreciate it. :thumbsup:

:D