Window

Availability

BlackBerry Device Software version 3.8 or later

The Window object is created automatically when the BlackBerry Browser encounters a <body> or <frameset> tag. It returns information about the window.

Properties

Property name

Type

Description

Status

Support level

Availability

applicationCache

ApplicationCache

Returns the ApplicationCache object that applies to the active document of that browser window.

read only

Offline Applications

6.0 or later

blackberry

blackberry

Returns a reference to the blackberry object.

read only

Not part of any standard

3.8 or later

closed

boolean

Returns whether the window is open or closed. This property always has a value of false.

read only

Not part of any standard

3.8 or later

document

Document

Returns the Document object that is contained within the window.

read only

Not part of any standard

3.8 or later

frameElement

HTMLElement

Returns the element in which the window is embedded, or null if the window is not embedded in any frame.

read only

Not part of any standard

3.8 or later

frames

NamedFrameMap

Returns a NamedFrameMap object that contains a collection of the frames contained by the frameset.

read only

Not part of any standard

3.8 or later

history

History

Returns the History object that contains a collection of recently accessed URLs.

read only

Not part of any standard

3.8 or later

innerHeight

int

Returns the height of the content area, including the horizontal scroll bar, if rendered.

read only

Not part of any standard

3.8 or later

innerWidth

int

Returns the width of the content area, including the vertical scroll bar, if rendered.

read only

Not part of any standard

3.8 or later

length

unsigned long

Returns the number of frames in the parent window.

read only

Not part of any standard

3.8 or later

localStorage

Storage

Returns a Storage object associated with the local storage area for the document's origin domain.

readonly

Web Storage

6.0 or later

location

Location

Specifies the URL of the document displayed in the browser window.

writable

Not part of any standard

3.8 or later

navigator

Navigator

Returns the Navigator object, which provides information about the BlackBerry Browser.

read only

Not part of any standard

3.8 or later

name

String

Specifies the name of the window.

writable

Not part of any standard

3.8 or later

opener

Window

Returns the Window object that created the window.

read only

Not part of any standard

3.8 or later

orientation

int

Returns an integer that represents the current orientation of a BlackBerry device that has an accelerometer, such as a BlackBerry Storm Series device.

This property can have one of the following values:

  • 0: The BlackBerry device is in portrait mode.
  • -90: The BlackBerry device is in landscape mode and is turned to the right
  • 90: the BlackBerry device is in landscape mode and turned to the left.

read only

Not part of any standard

4.7 or later

parent

Window

Returns the parent Window object.

read only

Not part of any standard

3.8 or later

screen

Screen

Returns the Screen object, which provides information about the BlackBerry device screen.

read only

Not part of any standard

3.8 or later

self

Window

Returns a reference to the current window.

read only

Not part of any standard

3.8 or later

sessionStorage

Storage

Returns a Storage object associated with the session storage area, which is available only for the current browser session.

readonly

Web Storage

6.0 or later

top

Window

Returns a reference to the top window.

read only

Not part of any standard

3.8 or later

window

Window

Returns a reference to the current window. Using the window property lets you invoke methods or call properties on the current window without confusion when multiple browser windows are open.

Because the BlackBerry Browser is a single document interface, a new window is opened each time a new URL is opened.

read only

Not part of any standard

3.8 or later

Event handlers

Property name

Type

Description

Status

Availability

onabort

EventListener

Specifies the function to perform when the loading of a page or image is aborted.

writable

4.6 or later

onchange

EventListener

Specifies the function to perform when a form control loses focus after the user has modified the value.

writable

4.6 or later

onclick

EventListener

Specifies the function to perform when the user clicks the trackball or trackwheel on a BlackBerry device.

writable

3.8 or later

onerror

EventListener

Specifies the function to perform when an ErrorEvent occurs in the worker thread.

writable

6.0 or later

onkeydown

EventListener

Specifies the function to perform when a key is pressed down while the pointer is over an element.

writable

4.6 or later

onkeypress

EventListener

Specifies the function to perform when a key is pressed and released while the pointer is over an element.

writable

4.6 or later

onkeyup

EventListener

Specifies the function to perform when a key is released while the pointer is over an element.

writable

4.6 or later

onload

EventListener

Specifies the function to perform when the BlackBerry Browser finishes loading a new page or a complete frameset.

writable

4.6 or later

onmessage

EventListener

Specifies the function to perform when a MessageEvent occurs in the worker thread.

writable

6.0 or later

onmousedown

EventListener

Specifies the function to perform when the user depresses the trackwheel or trackball on a BlackBerry device.

writable

4.6 or later

onmousemove

EventListener

Specifies the function to perform when the user moves the pointer while it is over an element.

writable

4.6 or later

onmouseout

EventListener

Specifies the function to perform when the user moves the pointer off of an element.

writable

4.6 or later

onmouseover

EventListener

Specifies the function to perform when the user moves the pointer over an element.

writable

4.6 or later

onmouseup

EventListener

Specifies the function to perform when the user releases the trackwheel or trackball on a BlackBerry device.

writable

4.6 or later

onorientationchange

EventListener

Specifies the function to perform when the user changes the orientation of a BlackBerry device that has an accelerometer, such as a BlackBerry Storm Series device.

writable

4.7 or later

onreset

EventListener

Specifies the function to perform when the user resets a form.

writable

3.8 or later

onselect

EventListener

Specifies the function to perform when the user selects some text in a text field.

writable

4.6 or later

onsubmit

EventListener

Specifies the function to perform when the user submits a form.

writable

3.8 or later

onunload

EventListener

Specifies the function to perform when the BlackBerry Browser removes a new page or a frameset.

writable

4.6 or later

Methods

Method name

Description

Support level

Availability

addEventListener()

Adds an EventListener object to a set of event listeners for the window.

DOM 2 Events

4.6 or later

alert()

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

blur()

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

clearInterval()

Cancels the interval set with setInterval().

HTML 5

6.0 or later

clearTimeout()

Cancels the timeout set with setTimeout().

HTML 5

6.0 or later

close()

Closes the active window.

Not part of any standard.

3.8 or later

confirm()

Displays a standard confirmation dialog box with an OK button and a Cancel button.

Not part of any standard.

3.8 or later

dispatchEvent()

Dispatches an Event object created by Document.createEvent().

DOM 2 Events

4.6 or later

find()

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

focus()

Gives focus to the current window.

Not part of any standard.

3.8 or later

getComputedStyle()

Retrieves the computed style values for an element.

DOM 2 Style

4.6 or later

moveBy()

Moves the window a specified number of pixels in relation to its current co-ordinates.

Not part of any standard.

3.8 or later

moveTo()

Moves the window's left and top edge to the specified co-ordinates.

Not part of any standard.

3.8 or later

open()

Opens a new browser window.

Not part of any standard.

3.8 or later

openDatabase()

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

postMessage()

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

print()

Prints the current contents of the window.

Not part of any standard.

3.8 or later

prompt()

Displays a prompt dialog box that prompts users for input.

Not part of any standard.

3.8 or later

removeEventListener()

Removes an event listener from an EventTarget.

DOM 2 Events

4.6 or later

requestAnimationFrame()

The requestAnimationFrame() method requests that the browser paint the next frame in an animation sequence.

Timing control for script-based animations

2.1+

resizeBy()

Resizes the viewport relative to the current viewport size.

Not part of any standard.

3.8 or later

resizeTo()

Resizes the viewport to the specified width and height.

Not part of any standard.

3.8 or later

scroll()

Scrolls the content to a given set of coordinates.

Not part of any standard.

3.8 or later

scrollBy()

Scrolls the content by the given number of pixels.

Not part of any standard.

3.8 or later

scrollTo()

Scrolls the content to a given set of coordinates.

Not part of any standard.

3.8 or later

setInterval()

Schedules a function or some code to run repeatedly at the specified interval.

HTML 5

6.0 or later

setTimeout()

Schedules a function or some code to run after a specified amount of time.

HTML 5

6.0 or later

stop()

Stops the current download.

Not part of any standard.

3.8 or later

Last modified: 2014-03-10



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus