Re: Controlling the Browser back button

by "Durwood Edwards" <durwoode(at)mindspring.com>

 Date:  Wed, 29 Nov 2000 15:22:01 -0600
 To:  <Bryce.Fields(at)mail.state.ky.us>,
<hwg-techniques(at)hwg.org>
 References:  ky
  todo: View Thread, Original
I get the message everytime. Perhaps there is a way to disable the alert?
----- Original Message -----
From: <Bryce.Fields(at)mail.state.ky.us>
To: <hwg-techniques(at)hwg.org>
Sent: Wednesday, November 29, 2000 12:50 PM
Subject: RE: Controlling the Browser back button


> Okay, I actually got this to work (sort of, see below) using a page that
> does something similar on the web site I administer.  We have a page on
the
> site that will produce a popup window w/ an image map, that when clicked,
> will close itself and open the link in the parent window.  I modified the
> JavaScript a bit and got the parent window to close upon loading the
popup.
>
> Here's what the JavaScript in the popup looks like (placed in the <head>
of
> course):
>
> function closeParent() {
> var parentWindow = window.opener;
> parentWindow.close();
> }
>
> and in the <body> tag of the popup window, the closeParent() function is
> called this way:
>
> <body onload="closeParent()">
>
> I'm not sure that it would work using the "target=_blank" method for
> generating the popup, but you wouldn't want to do it that way anyway.  If
> you use JavaScript to generate the new window, you get the extra added
> benefit of the JavaScript generated window has a fresh history, and is
> unlinkable to the parent once the parent window is closed.
>
> Now for "sort of" I alluded to above:  A few times (but not every time) I
> test the pages, I get a message from IE telling me that the popup was
trying
> to close the parent, should I let it continue.  Other times I don't get
the
> warning and everything proceeds as planned.  Also, I haven't checked how
> this works in other browsers, so I can't vouch for anything other than IE
> 5.5, but it's a start to a solution.  Any ideas?
>
> Bryce Fields
> Ecologist/Webmaster
> Kentucky State Nature Preserves Commission
> 801 Schenkel Lane
> Frankfort, KY 40601
> Ph: (502) 573-2886 Fax: (502) 573-2355
> bryce.fields(at)mail.state.ky.us <mailto:bryce.fields(at)mail.state.ky.us>
>
> "Do or do not!  There is no try! " -- Yoda
>
>
> -----Original Message-----
> From: Davies, Elizabeth H. [SMTP:EHDavies(at)West.com]
> Sent: Wednesday, November 29, 2000 10:36 AM
> To: HWG-technique Mailing List (E-mail)
> Subject: Controlling the Browser back button
>
> Is there a way to not only OPEN a new window (easy enough with the
> target_blank ability), but to also CLOSE the old browser window? I
> could not
> see how it could be accomplished while remaining in the same window
> since
> Browser's protect their history fairly well. You can make it harder
> with a
> redirect, but anyone who knows how to access the longer 'back
> history' or
> can click really fast will blow past that.
>
> The problem:
> I work on an intranet (IE 5.0+) and for security reasons am trying
> to
> prevent a user from going 'back' to their log-in page (where they
> can log
> into several different areas). When they go 'back' they don't
> actually log
> out, and they remain active. While they are supposed to log out,
> then log
> back into a different area, it's easier for them to simply hit
> 'back' ...
> Some of this can be controlled by the database access, but several
> users
> apparently don't realize that just because they are staring at a
> log-in
> screen (after they hit the back button), they are still logged on...
> then
> they wander off without logging out or in to a different area,
> leaving their
> desktop open for anyone to hit the 'forward' button and tromp.
>
> Elizabeth Davies
> Web Designer

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA