Object: Window
Window properties
Window event handlers
Window methods
|
Method name |
Description |
Support level |
Availability |
|---|---|---|---|
|
Adds an EventListener object to a set of event listeners for the window. |
DOM 2 Events |
4.6 or later |
|
|
Displays a standard alert dialog box with an OK button. |
Not part of any standard. |
3.8 or later |
|
|
atob() |
Decodes a string of text that has been encoded using base-64 encoding. |
Not part of any standard. |
6.0 or later |
|
Removes focus from the window. |
Not part of any standard. |
3.8 or later |
|
|
btoa() |
Encodes a string of text using base-64 encoding. The string can be decoded using atob(). |
Not part of any standard. |
6.0 or later |
|
Cancels the interval set with setInterval(). |
HTML 5 |
6.0 or later |
|
|
Cancels the timeout set with setTimeout(). |
HTML 5 |
6.0 or later |
|
|
Closes the active window. |
Not part of any standard. |
3.8 or later |
|
|
Displays a standard confirmation dialog box with an OK button and a Cancel button. |
Not part of any standard. |
3.8 or later |
|
|
Dispatches an Event object created by Document.createEvent(). |
DOM 2 Events |
4.6 or later |
|
|
Displays a dialog box that allows a user to enter a string of text and search for it in the current document. |
Not part of any standard. |
4.6 or later |
|
|
Gives focus to the current window. |
Not part of any standard. |
3.8 or later |
|
|
Retrieves the computed style values for an element. |
DOM 2 Style |
4.6 or later |
|
|
Moves the window a specified number of pixels in relation to its current co-ordinates. |
Not part of any standard. |
3.8 or later |
|
|
Moves the window's left and top edge to the specified co-ordinates. |
Not part of any standard. |
3.8 or later |
|
|
Opens a new browser window. |
Not part of any standard. |
3.8 or later |
|
|
Opens the given database on the BlackBerry device. If the database doesn't already exist, then a new database with the given name is created. |
HTML 5 |
6.0 or later |
|
|
Sends a message to the main thread of the Window object. The message contains the data to be passed between threads. |
HTML 5 |
6.0 or later |
|
|
Prints the current contents of the window. |
Not part of any standard. |
3.8 or later |
|
|
Displays a prompt dialog box that prompts users for input. |
Not part of any standard. |
3.8 or later |
|
|
Removes an event listener from an EventTarget. |
DOM 2 Events |
4.6 or later |
|
|
Resizes the viewport relative to the current viewport size. |
Not part of any standard. |
3.8 or later |
|
|
Resizes the viewport to the specified width and height. |
Not part of any standard. |
3.8 or later |
|
|
Scrolls the content to a given set of coordinates. |
Not part of any standard. |
3.8 or later |
|
|
Scrolls the content by the given number of pixels. |
Not part of any standard. |
3.8 or later |
|
|
Scrolls the content to a given set of coordinates. |
Not part of any standard. |
3.8 or later |
|
|
Schedules a function or some code to run repeatedly at the specified interval. |
HTML 5 |
6.0 or later |
|
|
Schedules a function or some code to run after a specified amount of time. |
HTML 5 |
6.0 or later |
|
|
Stops the current download. |
Not part of any standard. |
3.8 or later |
Method: window.alert()
Method: window.back()
The back() method displays the previous URL in the history list. This method is functionally equivalent to history.back().
Method: window.blur()
Method: window.close()
The close() method closes the active window. In the BlackBerry® Browser, this is functionally equivalent to window.back() and history.back().
If no earlier item exists in the window.history array, the BlackBerry Browser is closed and the browser session ends.
Method: window.confirm()
The confirm() method displays a standard confirmation dialog box with an OK button and a Cancel button.
Use a confirm dialog box when you want to give the user the option to proceed with or cancel some action. The user may not continue to browse or use the current page until they have closed the dialog box.
Method: window.find()
The find() method searches for a given string in the current window. If the search term was located within the window, the search stops and returns a value of true.
If the search is restarted with the same term, the browser continues searching from the location of the last search result. If you provide a new search term, the browser begins searching at the start of the document and stops and returns a value of true when the given term is found.
Note that the caseSensitive and searchInFrames parameters are optional, but mutually inclusive. That is, you must either specify both of the parameters or neither of them.
Parameters
Parameter |
Type |
Description |
|---|---|---|
str |
String |
The string of text to search for in the current document. |
caseSensitive |
boolean |
Optional. If true, indicates that the case of the search term should be considered when searching. |
searchInFrames |
boolean |
Optional. If true, indicates that the browser should search for the given term in all currently displayed frames. |
Method: window.focus()
Method: window.forward()
The forward() method displays the next URL in the history list of the browser. This method is functionally equivalent to history.forward().
Method: window.home()
Method: window.moveBy()
Method: window.moveTo()
Method: window.open()
The open() method opens a new browser window.
The BlackBerry® Browser is a single document interface. It opens a new window and places it at the top of the stack whenever the user opens a link on a page or enters a new URL via the Go to menu item. Consequently, this method essentially has the same net effect in the BlackBerry Browser as specifying a new value for Window.location.
Method: window.print()
Method: window.prompt()
The prompt() method displays a prompt dialog box that prompts users for input. A prompt dialog box includes a single line input field.
Use a prompt dialog when you need immediate feedback from the user. The user may not continue to browse or use the current page until they have closed the dialog box.
Method: window.resizeBy()
The resizeBy() method resizes the viewport relative to the current window size.
To resize the viewport to an absolute size, use window.resizeTo().
Method: window.scrollTo()
The scrollTo() method scrolls the content to a given set of coordinates. This method is functionally equivalent to window.scroll().
Method: window.scroll()
The scroll() method scrolls the content to a given set of coordinates. This method is functionally equivalent to window.scrollTo().
Method: window.stop()
- Method: window.home()
- Method: window.moveBy()
- Method: window.moveTo()
- Method: window.open()
- Method: window.print()
- Method: window.prompt()
- Method: window.resizeBy()
- Method: window.resizeTo()
- Method: window.scrollBy()
- Method: window.scrollTo()
- Method: window.scroll()
- Method: window.stop()