a string beginning with a question mark that specifies any query information in the url.
语法
1. links[index].search 2. location.search
index is an integer representing a link object.
property of
描述
the search property specifies a portion of the url.
you can set the search property at any time, although it is safer to set the href property to change a location. if the search that you specify cannot be found in the current location, you will get an error.
see section 3.3 of rfc 1738 for complete information about the search.
例子
in the following example, the window.open statement creates a window called newwindow and loads the specified url into it. the document.write statements display all the properties of newwindow.location in a window called msgwindow.
newwindow=window.open
("http://guide-p.infoseek.com/ww/ns/titles?qt=rfc+1738+&col=ww")
msgwindow.document.write("newwindow.location.href = " +
newwindow.location.href + "<p>")
msgwindow.document.write("newwindow.location.protocol = " +
newwindow.location.protocol + "<p>")
msgwindow.document.write("newwindow.location.host = " +
newwindow.location.host + "<p>")
msgwindow.document.write("newwindow.location.hostname = " +
newwindow.location.hostname + "<p>")
msgwindow.document.write("newwindow.location.port = " +
newwindow.location.port + "<p>")
msgwindow.document.write("newwindow.location.pathname = " +
newwindow.location.pathname + "<p>")
msgwindow.document.write("newwindow.location.search = " +
newwindow.location.search + "<p>")
msgwindow.document.write("newwindow.location.hash = " +
newwindow.location.hash + "<p>")
msgwindow.document.close()
the previous example displays the following output:
newwindow.location.href = http://guide-p.infoseek.com/ww/ns/titles?qt=rfc+1738+&col=ww newwindow.location.protocol = http: newwindow.location.host = guide-p.infoseek.com newwindow.location.hostname = guide-p.infoseek.com newwindow.location.port = newwindow.location.pathname = /ww/ns/titles newwindow.location.search = ?qt=rfc+1738+&col=ww newwindow.location.hash =
相关
select method
selects the input area of the specified password, text, or textarea object.
语法
1. passwordname.select() 2. textname.select() 3. textareaname.select()
passwordname is either the value of the name attribute of a password object or an element in the elements array.
textname is either the value of the name attribute of a text object or an element in the elements array.