JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference
Next Property

Name Property---the query portion of a URL


Navigator 2.0, Internet Explorer 3.0



The search is a read/write string property of the URL object. It specifies the query portion of a URL, including the leading question mark. For example, the search of the following (fictitious) location is "?query=JavaScript&matches=666".

Note that the search string (also known as a query string) is not parsed: it still contains the "?" prefix--which you can remove with String.substring(1)--and, more important, it is not split along the "&" delimiter into individual variables. See the split method of the String object for an easy way to break it up in Navigator 3.0.

See Also

"Area", "Document.links[]", "Link", "String.split()", "URL", "Window.location"

Previous Home Next
URL.protocol Book Index window

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell
Hosted by uCoz