Basic HTML version of Foils prepared 23 June 1997

Foil 16 JavaScript URLs

From JavaScript Tutorial for Certificate Course UC Web applications Certificate -- Summer 97. by Geoffrey C. Fox, Tom Scavo

Interpreted JavaScript
One can demonstrate JavaScript as an interpreter by typing javascript: into location field of your browser.
  • This gives a two frame window where you can directly type JavaScript and see response
One can execute arbitrary JavaScript code in anchors and other tags:
  • <a href="javascript:history.go(-1)">Go Back</a>
  • This loads the previously visited page
  • Using history.go(0) would reload the current page
The JavaScript Guide describes some interesting examples, including this client-side image map:
  • <MAP name="buttonbar">
  • <AREA shape="rect" coords="0,0,16,14"
  • HREF="javascript:top.dosomething();
  • top.frames[1].location='URLotherframe.html';" >
  • </MAP>



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 Apr 1 1998