JavaScript » Objects » Screen

A Screen object, automatically created by the JavaScript runtime engine, returns information on the display screen's dimensions and color depth.

Properties

availHeight

Syntax: screen.availHeight

This property returns the height of the screen in pixels, minus any permanent or semi-permanent components of the operating system's interface i.e. Windows' Taskbar feature.

availWidth

Syntax: screen.availWidth

This property returns the width of the screen in pixels, minus any permanent or semi-permanent components of the operating system's interface i.e. Windows' Taskbar feature

colorDepth

Syntax: screen.colorDepth

If a color palette is in use, this property returns its bit depth. If not, the value reflects the screen.pixelDepth property.

constructor

Syntax: Object.constructor

This specifies a function to create an object's property and is inherited by all objects from their prototype.

height

Syntax: screen.height

This property returns the height of the display screen.

pixelDepth

Syntax: screen.pixelDepth

This property returns the color resolution, in bits per pixel, of the display screen.

prototype

Syntax: Object.prototype.name = value

This allows the addition of properties and methods to any object.

width

Syntax: screen.width

This property returns the width of the display screen.

Methods

eval

Syntax: Object.eval(string)

The eval method is deprecated as a method of Object, but is still used as a high level function. It evaluates a string of JavaScript in the context of an object.

toSource

Syntax: Object.toSource()

The toSource method returns a literal representing the source code of an object. This can then be used to create a new object.

toString

Syntax: Object.toString()

The toString method returns a string representing a specified object.

unwatch

Syntax: Object.unwatch(property)

This method removes a watchpoint set for an object and property name with the watch method.

valueOf

Syntax: Object.valueOf()

This method returns a primitive value for a specified object.

watch

Syntax: Object.watch(property, handlerfunction)

This method adds a watchpoint to a property of the object.

See Also: