Course Technology logoCourse Technology
Appendix D

*
 Online 
    Companion 
 Home 

directory folder
Documents 

 HTML: 
 Tutorial 1 
 Tutorial 2 
 Tutorial 3 
 Tutorial 4 
 Tutorial 5 
 Tutorial 6 
 Tutorial 7 
 Tutorial 8 
 Tutorial 9 
 Tutorial 10 


DHTML: 
 Tutorial 1 
 Tutorial 2 
 Tutorial 3 
 Tutorial 4 
 Tutorial 5 


directory folder
Gallery 

directory folder
Software 


directory folder
Data Files 


directory folder
Reference: 

HTML Tags 

 Appendix D: 
 JavaScript 
 Objects, 
 Properties, 
 Methods, 
 Event 
 Handlers 

 Appendix E: 
JavaScript 
 Operators, 
 Elements, 
 Keywords 
  
 Appendix F: 
 Cascading 
 Style Sheets 



Web Pages and HTML icon

Online Companion Home * Appendix D: Main 
spacer

Appendix D
JavaScript Objects, Properties, and Methods


The following are some of the more important JavaScript objects, properties, and methods. The two columns at the right indicate the earliest Netscape and Internet Explorer versions that support these JavaScript commands. For example, a version number of "4.0" for Internet Explorer indicates that versions of Internet Explorer 4.0 and above support the tag or attribute.

Many objects should be referred to by their names within the Web document. For example, to apply the click() method to a button named "RUN," use the JavaScript command:

RUN.click();


A
Anchor, Applet, Area, Array

JavaScript ElementsDescriptionIENetscape

Anchor

An anchor in the document (use the anchor's name) 4.0 4.0
Properties



name

The name of the anchor

4.0 4.0
text

The anchor text


4.0

To the top

JavaScript ElementsDescriptionIENetscape

Applet

A Java applet in the document (use the applet's name)

4.03.0
Properties



name

The name of the applet


3.0

To the top

JavaScript ElementsDescriptionIENetscape

Area

An area defined in an image map (use the area's name)

3.0 3.0
Properties



hash

The anchor name from the URL

3.0 3.0
host

The host and domain name from the URL

3.0 3.0
hostname
The hostname from the URL3.0 3.0
href

The entire URL

3.0 3.0
pathname

The pathname from the URL

3.0 3.0
port

The port number from the URL

3.0 3.0
protocol

The protocol from the URL

3.0 3.0
search

The query portion from the URL

3.0 3.0
target

The TARGET attribute of the <AREA> tag

3.0 3.0
Methods



getSelection()

Returns the value of the current selection


3.0
Event Handlers



onDblClick()

Runs when the area is double-clicked

4.0 4.0
onMouseOut()

Runs when the mouse leaves the area

3.0 3.0
onMouseOver()

Runs when the mouse enters the area

3.0 3.0

To the top

JavaScript ElementsDescriptionIENetscape

Array

An array object

3.0 3.0
Properties



length

The number of elements in the array

3.0 3.0
prototype

A mechanism to add properties to an array object

3.0 3.0
Methods



concat(array)

Combines two arrays, storing the results in a third array named array

4.0 4.0
join(string)

Stores each element, separated by commas, in a text string named string

3.0 3.0
reverse()

Reverses the order of the array

3.0 3.0
pop()

"Pops" the last element off the array and reduces the length of the array by 1


4.0
push(arg1,
arg2, ...)

"Pushes" the elements in the list to the end of the array


4.0
slice(array,
begin, end)

Extracts a portion of the array starting at the index number begin, and ending at index number end; the elements are then stored in array

4.0 4.0
sort(function)

Sorts the array based on the function named function; if function is omitted, the sort applies dictionary order to the array

3.0 3.0

To the top

*Appendix D:
Javascript Objects, Properties, and Methods
Detailed Contents - A  -  B, C  -  D  -  E, F
G, H, I  -  L  -  M, N, O  -  P, R  -  S  -  T  -  W


*Online Companion Home  
*Software  *Gallery  directory folderData Files  
*Documents: HTML: Tutorial 1 | Tutorial 2 | Tutorial 3 | Tutorial 4
Tutorial 5 | Tutorial 6 | Tutorial 7 | Tutorial 8 | Tutorial 9 | Tutorial 10
DHTML: Tutorial 1 | Tutorial 2 | Tutorial 3 | Tutorial 4 | Tutorial 5

*Reference:  HTML Tags, Properties | Appendix D:Web Pages and HTML icon
JavaScript Objects, Properties, Methods, Event Handlers
Appendix E:  JavaScript Operators, Elements, Keywords
Appendix F:  Cascading Style Sheets

To the top

*
Website design by SKDesigns.Course Technology © 2000*
*