This property yields a text string that contains the query value from the URL if there is one and an empty string if not.
This should really be called the query portion of the URL instead of the search attribute.
You can assign a new value to this property. This might be useful if the user needs to specify some search parameters, which can be range checked at the client end. You will need to prefix the new value with a question mark otherwise the assignment won't work.
It is probably named 'search' due to it having been used by search engines, and that being the way people first noticed its widespread use when inspecting their web server's referrer logs.
<HTML> <HEAD> </HEAD> <BODY> <A NAME="EXAMPLE" HREF="http://www.mydomain.com:8080/folder/file.html#abcdef">Click here</A><BR> <SCRIPT> // In testing, this did not work in Opera 5.0 document.write(document.links[0].search); </SCRIPT> </BODY> </HTML>
Prev | Home | Next |
Url.rev | Up | Url.shape |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |