Basic HTML version of Foils prepared July 9 99

Foil 67 Is a variable defined?

From Distance Education: How to do it DoD HPC Modernization Users Group Tutorial Monterey California, ACM Java Grande San Francisco, EDMEDIA Seattle -- June 7 99, June 14 99, June 20 99. by Geoffrey C. Fox


1 One must NEVER access an undefined variable
  • if in JavaScript that is linked to LiveConnect, one gets a Java error which requires restarting Netscape .....
  • If in less sensitive JavaScript, execution of script stops and action unpredictable
2 Until page fully formed, any of its properties can be undefined
3 Modern JavaScript allows one to test if variables are defined and so avoid these errors
4 in a.b.c.d.e type reference, one must first test if a exists, then b, then ....
5 WWutility.js includes
  • WW_isdefined(property) returns true if argument is defined as a property or method
  • WW_isitawindow(possibleframe) returns true if argument is a window or frame

in Table To:


© 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 Jul 9 1999