Basic HTML version of Foils prepared 3 March 99

Foil 28 JavaScript URLs

From Overview of JavaScript I -- Basic Web Scripting Language CPS616 Technologies of the Information Age -- Spring Semester 99. by Geoffrey C. Fox (Tom Scavo)

JavaScript URLs for Foil 28
1 A trivial example of a JavaScript URL is javascript:alert("Hello World!")
2 A JavaScript URL may appear anywhere an ordinary URL is expected: <A HREF="javascript:history.back()">Previous Page</A>
3 Note must use <A HREF=" javascript: void(anyoldfunction())" > if you do not want link to be invoked!
  • Use HREF="javascript: void(0)" if no action at all -- used if real action from onclick or other event handle for link
4 Navigator even has a mini-scripting environment invoked by typing javascript:into the browser's location text field
  • This is now (NN4.5) used to display error messages as a console instead of alternative (and clumsy) stream of windows (one per error ....)

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 Wed Mar 3 1999