Re: original question
Why not use Window.unload, that is fully cross platform (JavaScript 1.0)
and works both in <BODY> and <FRAMESET>?
For example what happens if a user opens up a frame in a new browser
window?
Also, why not just have the handler execute the logout for them? This
might also catch people who quit the browser also, since I presume (this
is a SWAG actually) that when a browser quits normally it cleans up after
itself -- closing windows, shutting down the JVM, etc.
>Hi David,
>
>You need a check variable of some sort, kind of like:
>
><script>
>var stopVar = 1;
>function closeIt()
>if(stopVar){
> event.returnValue = "Any string value here will force a dialog box to
>appear before closing the window.";
>}
>function Logout(){
> //
> // put your logout code here
> //
> window.close();
>}
></script>
>
><button onclick="stopVar = 0; Logout();">Logout</button>
>
>I haven't tested this, but something like the above should work, depending
>on how you do your logout of course.
>
>Hope this helps. Cheers...
>
>----- Original Message -----
>From: "David Green" <[EMAIL PROTECTED]>
>To: "Multiple recipients of list witango-talk" <[EMAIL PROTECTED]>
>Sent: Wednesday, August 21, 2002 8:03 AM
>Subject: Re: Witango-Talk: [OT... kind of] Javascript Question
>
>
>> Thanks for all the help... while we're still on the subject, I need to
>> take this a step further. I can now put up a alert box asking the user
>> to please logout of the system instead of closing the browser. That's
>> fine, but after the alert box, I want to stop the window from closing.
>>
>> Is this possible? If so, how? And yes, as Scott said, I'm lucky enough
>> to only have to worry about MSIE 5.0 and above.
>>
>> Thanks,
>>
>> Dave Green
>> [EMAIL PROTECTED]
>>
>> Scott Cadillac wrote:
>> >
>> > Hi Harpreet,
>> >
>> > David did mention in his original post that he needed it for IE 5.0 and
>> > above:-).
>> >
>> > Cheers....
>> >
>> > Scott Cadillac
>> > http://xml-extra.net
>> > [EMAIL PROTECTED]
>> >
>> > http://witango.org
>> > [EMAIL PROTECTED]
>> >
>> > ----- Original Message -----
>> > From: "Harpreet Matharu" <[EMAIL PROTECTED]>
>> > To: "Multiple recipients of list witango-talk"
><[EMAIL PROTECTED]>
>> > Sent: Wednesday, August 21, 2002 6:51 AM
>> > Subject: RE: Witango-Talk: [OT... kind of] Javascript Question
>> >
>> > > But neither NetScape 4x nor NetScape 6x supports this event!!!
>> > >
>> > > -----Original Message-----
>> > > From: [EMAIL PROTECTED]
>> > > [mailto:[EMAIL PROTECTED]]On Behalf Of David Green
>> > > Sent: Tuesday, August 20, 2002 12:09 PM
>> > > To: Multiple recipients of list witango-talk
>> > > Subject: Re: Witango-Talk: [OT... kind of] Javascript Question
>> > >
>> > >
>> > > Thanks Scott... that's exactly what I was looking for.
>> > >
>> > > Although... I may still try Robert's idea! ;)
>> > >
>> > > Dave Green
>> > > [EMAIL PROTECTED]
>> > >
>> > > Scott Cadillac wrote:
>> > > >
>> > > > Hi David,
>> > > >
>> > > > It appears the ONBEFOREUNLOAD event is supported in the FRAMESET
>> > element
>> > > > for MSIE.
>> > > >
>> > > > Try:
>> > > >
>> > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>> > > > <HTML>
>> > > > <HEAD>
>> > > > <TITLE>onbeforeunload Sample</TITLE>
>> > > > <SCRIPT>
>> > > > function closeIt()
>> > > > {
>> > > > event.returnValue = "Any string value here will force a dialog box
>to
>> > > > appear before closing the window.";
>> > > > }
>> > > > </SCRIPT>
>> > > > </HEAD>
>> > > > <FRAMESET COLS="50%, 50%" ONBEFOREUNLOAD="closeIt()">
>> > > > <FRAME SRC="http://witango.org">
>> > > > <FRAME SRC="http://witango.org">
>> > > > </FRAMESET>
>> > > > </HTML>
>> > > >
>> > > > Hope this helps. Cheers...
>> > > >
>> > > > Scott Cadillac
>> > > > VP, Research and Development
>> > > > Plus International Corp.
>> > > > 604-469-6543
>> > > > [EMAIL PROTECTED]
>> > > > http://www.plusinternational.com
>> > > >
>> > > > Vancouver, BC, Canada
>> > > >
>> > > > Does your company have an Enterprise Information Portal? Check out
>> > Salsa
>> > > at
>> > > > www.plusinternational.com/flash/salsa.htm
>> > > >
>> > > > ----- Original Message -----
>> > > > From: "David Green" <[EMAIL PROTECTED]>
>> > > > To: "Multiple recipients of list witango-talk"
>> > <[EMAIL PROTECTED]>
>> > > > Sent: Tuesday, August 20, 2002 7:24 AM
>> > > > Subject: Witango-Talk: [OT... kind of] Javascript Question
>> > > >
>> > > > > Hello all,
>> > > > >
>> > > > > I have a intranet site where when users login, they are directed
>to a
>> > > > > frames based page. This gives them a drop down menu in the top
>frame
>> > > > > and the other being the body frame. What I want to do is force
>the
>> > user
>> > > > > to logout using the drop down menu instead of just closing the
>> > browser.
>> > > > > I just want to give the user an error like alert('Please choose
>> > logout
>> > > > > from the menu');
>> > > > >
>> > > > > I'm using IE 5.0 and above. I'm trying to use the onBeforeUnload
>> > > > > function but still not getting exactly what I want. I'm not sure
>if
>> > > > > it's because of the frames or not, but the browser ignores the
>body
>> > tag
>> > > > > on the parent page.
>> > > > >
>> > > > > Any help is greatly appreciated!
>> > > > >
>> > > > > Thanks,
>> > > > >
>> > > > > Dave Green
>> > > > > [EMAIL PROTECTED]
>> > > > >
>> >
>________________________________________________________________________
>> > > > > TO UNSUBSCRIBE: send a plain text/US ASCII email to
>> > [EMAIL PROTECTED]
>> > > > > with unsubscribe witango-talk in the message body
>> > > > >
>> > > >
>> > > >
>> >
>________________________________________________________________________
>> > > > TO UNSUBSCRIBE: send a plain text/US ASCII email to
>> > [EMAIL PROTECTED]
>> > > > with unsubscribe witango-talk in the message body
>> > >
>________________________________________________________________________
>> > > TO UNSUBSCRIBE: send a plain text/US ASCII email to
>[EMAIL PROTECTED]
>> > > with unsubscribe witango-talk in the message body
>> > >
>> > >
>________________________________________________________________________
>> > > TO UNSUBSCRIBE: send a plain text/US ASCII email to
>[EMAIL PROTECTED]
>> > > with unsubscribe witango-talk in the message body
>> > >
>> >
>> >
>________________________________________________________________________
>> > TO UNSUBSCRIBE: send a plain text/US ASCII email to
>[EMAIL PROTECTED]
>> > with unsubscribe witango-talk in the message body
>>
>> ________________________________________________________________________
>> TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
>> with unsubscribe witango-talk in the message body
>>
>
>________________________________________________________________________
>TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
> with unsubscribe witango-talk in the message body
>
Bill Conlon
To the Point
345 California Avenue Suite 2
Palo Alto, CA 94306
office: 650.327.2175
fax: 650.329.8335
mobile: 650.906.9929
e-mail: mailto:[EMAIL PROTECTED]
web: http://www.tothept.com
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
with unsubscribe witango-talk in the message body