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


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
Until page fully formed, any of its properties can be undefined
Modern JavaScript allows one to test if variables are defined and so avoid these errors
in a.b.c.d.e type reference, one must first test if a exists, then b, then ....
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



© 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