Basic HTML version of Foils prepared 23 June 1997

Foil 61 JavaScript Link Example

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


<a href="" onClick="top.seturl(this,'item27.html')" onMouseOver="window.status='this is a test of onMouseOver'; return true">Exciting Item 27</a>
This is a very typical use of onClick in a hyperlink
Keyword this refers to current link object of type location
Set href to anything, even "", but do not omit otherwise won't be a link Ñ will be an anchor instead!
Set href and target frame in onClick event handler:
function seturl(linkname, fileurl) {
linkname.target = "top.mainframe";
linkname.href = fileurl); }
Put seturl in top frameset document. The <a> link is in a frame where onClick allows seturl to load required document into mainframe, the main display 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 Wed Apr 1 1998