Availability: |
| |||
Deprecated: |
| |||
Property/method value type: | Boolean primitive | |||
JavaScript syntax: | - | find() | ||
- | find(aSearchKey) | |||
- | find(aSearchKey, aCaseSense) | |||
- | find(aSearchKey, aCaseSense, aDirection) | |||
- | myWindow.find() | |||
- | myWindow.find(aSearchKey) | |||
- | myWindow.find(aSearchKey, aCaseSense) | |||
- | myWindow.find(aSearchKey, aCaseSense, aDirection) | |||
Argument list: | aCaseSense | A switch for case sensitivity | ||
aDirection | A direction to search | |||
aSearchKey | The 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() |
Prev | Home | Next |
Window.external | Up | Window.focus() |
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. |