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


1 <a href="" onClick="top.seturl(this,'item27.html')" onMouseOver="window.status='this is a test of onMouseOver'; return true">Exciting Item 27</a>
2 This is a very typical use of onClick in a hyperlink
3 Keyword this refers to current link object of type location
4 Set href to anything, even "", but do not omit otherwise won't be a link Ñ will be an anchor instead!
5 Set href and target frame in onClick event handler:
6 function seturl(linkname, fileurl) {
7 linkname.target = "top.mainframe";
8 linkname.href = fileurl); }
9 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

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