Basic HTML version of Foils prepared 23 June 1997

Foil 52 Use of Dummy Frames in JavaScript

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


<HEAD><SCRIPT>...</SCRIPT></HEAD>
<BODY>
Various actions that load a new URL into page
</BODY>
will result in the loss of all JavaScript methods and properties!
This can be avoided by using dummy frames:
<HEAD><SCRIPT>...</SCRIPT></HEAD>
<FRAMESET ROWS="1,*">
<FRAME NAME="DUMMY">
<FRAME NAME="ActualFrame"
  • SRC="Thiscontainsoldbodyhtml.html">
</FRAMESET>
Now use <a href="URL" target="ActualFrame"> so that reloading will NOT destroy your JavaScript!
Note we defined a dummy frame above ActualFrame that occupies one pixel (could use zero!). The * notation tells Netscape to assign the remaining rows to the second 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