Ticket #471 ( Closed )

Short Description How can we give onunload event in expression
Entered By: rshanker@att.com When: 2000-03-02 10:17:09 Build: 2.0.6F
Categories Type: Question   Department: Product   Category: Not Categorized
Description
Hi 
I want to close the Session whenever user closes the browser
I am just trying to give onunload event in the 
<TEMACRO TERMBODY> tag
but its giving error 
can u please tell us how can i call afunction which i want 
when the browser is being closed 

Append By: WindSurfer  When: 2000-03-02 10:31:13  New Status: Pending Customer
Comment
The correct syntax would be:

<TEMACRO TERMBODY 'onunload="MyUnloadFunc()"'>

If you need to include quotes in your call to MyUnloadFunc, 
you would "escape" the single quote, as in:

<TEMACRO TERMBODY 'onunload="MyUnloadFunc(\'Hello\')"'>

This is because the text literal you are including is a 
single-quoted text literal.  Screensurfer supports text 
literals that are initiated with either a double or single 
quote--if you then need to use the same character inside the 
string, you need to escape it with the backslash.

Note that the onunload will be called EVERY page 
change...you will then need to check WHY the page was 
unloaded, and this might not be so easy?