PROPERTY:
Location::search
location.search
search is a property of both the Link
and the Location objects and is a
string beginning with a question mark that specifies any query information
in an HTTP URL. It contains one or more pairs of variables and values,
separated by ampersands. Assuming your current window to be the URL...
http://home.newco.com/products/enquiries.htm#local?email=name@otherco.com
...you could find out the search property as follows:
Code:
document.write(location.search)
Output:
?email=name@otherco.com
NOTE:
Although the search property can be set at any time, it is
safer to set the href property
to change a location.
|