[Previous] [Next] [TOC] 


Properties

This section list new and revised properties for:


Function Property

arity

Core property. When the LANGUAGE attribute of the SCRIPT tag is "JavaScript1.2", this property indicates the number of arguments expected by a function.

Syntax

functionName.arity

Parameters

functionName is the name of a function.

Property of

Function object

Description

arity is external to the function, and indicates how many arguments the function expects. The length property is internal to the function and indicates how many arguments were passed to the function. For more information on the length property, see the "JavaScript Guide."

Example

The following example demonstrates the use of arity and length.

<SCRIPT LANGUAGE = "JavaScript1.2">
function addNumbers(x,y){ 
  document.write("length = " + arguments.length + "<BR>") 
  z = x + y 
} 

document.write("arity = " + addNumbers.arity + "<BR>") 

addNumbers(3,4,5)
</SCRIPT>

This writes:

arity = 2
length = 3

navigator Properties

language

Client-side property. Indicates the translation of the Navigator being used.

Syntax

navigator.language

Property of

navigator object

Description

The language property has been added for use with the JAR Manager. For more information, see the "JAR Installation Manager Developer's Guide."

The value for language is usually a two-letter code, such as "en" and occasionally a five-character code to indicate a language sub-type, such as "zh_CN".

Webpage authors would use this property when they need to determine the language of the Navigator client software being used. For example the scripter could display translated text for the user.

language is a read-only property.


platform

Client-side property. Indicates the machine type for which the Navigator was compiled.

Syntax

navigator.platform

Property of

navigator object

Description

The platform property has been added for use with the JAR Manager. For more information, see the "JAR Installation Manager Developer's Guide."

The machine type the Navigator was compiled for may differ from the actual machine type due to version differences, emulators, or other reasons.

Webpage authors would use this property to ensure that their triggers download the appropriate JAR files. The triggering page checks the Navigator version before checking the platform property.

JAR-install writers would use this property to double-check that their package is being installed on an appropriate machine, or for small JAR's to decide which of several machine-specific files to install.

Platform values are Win32, Win16, Mac68k, MacPPC and various Unix.

platform is a read-only property.


window Properties

innerHeight

Client-side property. Specifies the vertical dimension, in pixels, of the window's content area.

Syntax

[windowReference.]innerWidth

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

To create a window smaller than 100 x 100 pixels, set this property in a signed script.


innerWidth

Client-side property. Specifies the horizontal dimension, in pixels, of the window's content area.

Syntax

[windowReference.]innerWidth

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

To create a window smaller than 100 x 100 pixels, set this property in a signed script.


locationbar

Client-side object and a property of the window object. Represents the Navigator window's location bar.

Syntax

[windowReference.]locationbar.visible

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

The locationbar object has one property, visible, that allows you to hide or show the location bar of the specified window.

This property must be set in a signed script.

Property

visible = [true, false] | [1, 0]

Example

The following example hides the location bar of myWindow.

myWindow.locationbar.visible=false


menubar

Client-side object and a property of the window object. Represents the Navigator window's menu bar.

Syntax

[windowReference.]menubar.visible

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

The menubar object has one property, visible, that allows you to hide or show the menu bar of the specified window.

This property must be set in a signed script.

Property

visible = [true, false] | [1, 0]

Example

The following example hides the menu bar of myWindow.

myWindow.menubar.visible=false


outerHeight

Client-side property. Specifies the vertical dimension, in pixels, of the window's outside boundary.

Syntax

[windowReference.]innerWidth

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

To create a window smaller than 100 x 100 pixels, set this property in a signed script.


outerWidth

Client-side property. Specifies the horizontal dimension, in pixels, of the window's outside boundary.

Syntax

[windowReference.]innerWidth

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

To create a window smaller than 100 x 100 pixels, set this property in a signed script.


pageXOffset

Client-side property. Provides the current x-position, in pixels, of a window's viewed page.

Syntax

windowReference.pageXOffset

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

The pageXOffset property provides the current x-position of a page as it relates to the upper-left corner of the window's content area. This property is useful when you need to find the current location of the scrolled page before using scrollTo or scrollBy.

This is a read-only property.

Example

The following example returns the x-position of the viewed page.

x = myWindow.pageXOffset

See Also

pageYOffset


pageYOffset

Client-side property. Provides the current y-position, in pixels, of a window's viewed page.

Syntax

windowReference.pageYOffset

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

The pageYOffset property provides the current y-position of a page as it relates to the upper-left corner of the window's content area. This property is useful when you need to find the current location of the scrolled page before using scrollTo or scrollBy.

This is a read-only property.

Example

The following example returns the y-position of the viewed page.

x = myWindow.pageYOffset

See Also

pageXOffset


personalbar

Client-side object and a property of the window object. Represents the Navigator window's personal bar (also called the directories bar).

Syntax

[windowReference.]personalbar.visible

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

The personalbar object has one property, visible, that allows you to hide or show the personal bar of the specified window.

This property must be set in a signed script.

Property

visible = [true, false] | [1, 0]

Example

The following example hides the personal bar of myWindow.

myWindow.personalbar.visible=false


scrollbars

Client-side object and a property of the window object. Represents the Navigator window's scroll bars.

Syntax

[windowReference.]scrollbar.visible

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

The scrollbars object has one property, visible, that allows you to hide or show the scroll bar of the specified window.

This property must be set in a signed script.

Property

visible = [true, false] | [1, 0]

Example

The following example hides the scroll bar of myWindow.

myWindow.scrollbars.visible=false


statusbar

Client-side object and a property of the window object. Represents the Navigator window's status bar.

Syntax

[windowReference.]statusbar.visible

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

The statusbar object has one property, visible, that allows you to hide or show the status bar of the specified window.

This property must be set in a signed script.

Property

visible = [true, false] | [1, 0]

Example

The following example hides the status bar of myWindow.

myWindow.statusbar.visible=false


toolbar

Client-side object and a property of the window object. Represents the Navigator window's tool bar.

Syntax

[windowReference.]toolbar.visible

Parameters

windowReference is either the name of a window object or one of the synonyms top or parent.

Property of

window object

Description

The toolbar object has one property, visible, that allows you to hide or show the toolbar of the specified window.

This property must be set in a signed script.

Property

visible = [true, false] | [1, 0]

Example

The following example hides the tool bar of myWindow.

myWindow.toolbar.visible=false


[Previous] [Next] [TOC] 



Copyright © 1997 Netscape Communications Corporation