HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 21 February 97

Foil 15 User Defined Objects Continued

From Feb 17/19 Delivered Lecture for Course CPS616 -- aJavaScript Language Objects and Frames CPS616 spring 1997 -- Feb 17 and 19 1997. by Geoffrey Fox * See also color IMAGE
Secs 146.8
You can access object properties in a natural fashion such as:
var actualselected = worldmenu.menuselection;
familymenu.color = 'red';
Curiously you can also use in Netscape 2 an array like notation to which we will return:
familymenu[0] is same as familymenu.no
familymenu[1] is same as familymenu.name etc.
We will return to this when we discuss arrays
One can associate methods with user objects but with a syntax that appears very limiting as object methods have identical arguments to function
General Syntax is:
Objectname.methodname = functionname;
where Objectname is an existing Object and functionname is an existing function -- it can be used to set event handlers with no arguments!


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Fri Feb 21 1997