Q1. Use the onUnload handler in the BODY tag or FRAMESET tag. eg:
<BODY onUnload="cleanUp();"> ... be sure to declare this function under the
<HEAD> tag.
Q2. Internet Explorer and Netscape display the HTML source, including
Javascript.
I do not think it is possible to turn this feature off.
Vyas
Shashank Phadke wrote:
> Hi --
>
> Sorry for this little offtopic posting .. but I am sure many of us must be
> playing around with Javascript to get my answers :-)
>
> How do I do the following in Javascript, if possible :
>
> 1.
> Handle close of window event when the user closes the window. This will be
> useful for many servlet based apps to 'unbound' sessions.
>
> 2.
> Can I stop the user from viewing the source code ? Typically this gets
> important when wanting to hide the session id and at the same time CANNOT
> USE COOKIES (end user requirement !!).
>
> In case 2, a potential hacker can make use of the session id to 'generate'
> HTML for his/her own benefit. Lets assume SSL not used !
>
> Anyone having played with this trivial tasks in Javascript ? Any pointers
> would be highly appreciated ..
>
> Thanks
> Shashank
>
> _______________________________________________________________
> Get Free Email and Do More On The Web. Visit http://www.msn.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html