Window.find() (Method)

This duplicates the behavior of the FIND button on the Netscape Navigator button bar.


JavaScript - 1.2
Netscape - 4.0

Netscape - 6.0
Property/method value type:Boolean primitive
JavaScript syntax:-find()
-find(aSearchKey, aCaseSense)
-find(aSearchKey, aCaseSense, aDirection)
-myWindow.find(aSearchKey, aCaseSense)
-myWindow.find(aSearchKey, aCaseSense, aDirection)
Argument list:aCaseSenseA switch for case sensitivity
aDirectionA direction to search
aSearchKeyThe text to search for

All of the arguments are optional. However, you must specify the first argument if want to specify the second and so on.

If no arguments are specified, a dialog box is presented to the user for them to specify the search attributes.

The search key is a arbitrary string of characters. The search facility will look for this string in the current page.

The case sensitive switch parameter must be true to force a case sensitive search and false to ignore case. By default a case insensitive search is carried out if this argument is omitted.

The direction switch is a true for a backwards search and false for a forwards search. The default is a forwards search if this argument is omitted.

Forward searches commence at the current cursor position or immediately after the current selection if there is one (position A on the diagram). If there is no selection or the cursor has not been focussed into the page and positioned there, then the search begins at the top of the document. In the case of a backwards direction, the search starts immediately in front of the selection if there is one or the end of the document if not.

The result is true if the text was found in the page and false if it was absent.

See also:Frame object, Window object, Window.home(), Window.print(), Window.stop()