Tom said:
A Java applet has two methods stop() and destroy() that get called
when the user moves to a different page. Does javascript have
anything similar?
From the Java 1.4.2 API documentation:
| destroy()
| Called by the browser or applet viewer to inform this applet
| that it is being reclaimed and that it should destroy any
| resources that it has allocated.
|
| [...]
| stop()
| Called by the browser or applet viewer to inform this applet
| that it should stop its execution.
Why do you require anything similar in client-side JavaScript?
Almost all references are tied to the current document, that is, they
do not longer exist if the document resource is changed. The script
engine's garbage collector will automatically free memory allocated
for objects and other data if there are no more references to them and
the script engine stops execution as soon as the execution context that
it is invoked for ends (but it preserves references to the allocated
memory).
PointedEars