HELP! * GREY=local LOCAL HTML version of Foils prepared 15 January 1997

Foil 26 Example of a JavaScript Function

From JavaScript Tutorial for CPS616 Technologies of the Information Age 1997 Basic Information Track of CPS -- Spring Semester 97. by Geoffrey C. Fox * Important Information in IMAGE
Addon
top.setframe("help.html","maindisplay");
function setframe(relativeurldesired,framelabel) {
  • var actualurl = top.baseurl + relativeurldesired;
  • top.frames[framelabel].location.href = this.actualurl;
}
top is a Netscape(Navigator) object with a property frames which is an array labelled by either integers or by value of name attribute in <frame> name="textofframelabel" </frame> tag
Setting a URL into location.href property of a frame loads that page into given frame.
top labels functions defined in page that defines frames
use this.actualurl to distinguish function's variable actualurl from a global variable of same name
Put these functions in <head> </head> section so as to ensure they are loaded before anything else



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 Feb 19 1997