JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
detecting that browser BACK button was clicked Posted by clk0893 on 22 Oct 2002 at 2:03 PM
i need to create a script that will popup an ad. the user WILL NOT get the ad if they click on the browsers BACK button or CLOSE the browser w/ the little upperright X box.

in IE i've found a way to detect it by using screenX & Y's.

But i have not found a way to detect that the user has clicked the BACK button on NS. has anyone ever done this before? thx.
Report
Re: detecting that browser BACK button was clicked Posted by Souldrinker on 23 Oct 2002 at 12:34 AM
I guess this does not work this way...

you could try to use the "document.referrer" to check if the users moves inside your pages, and then shoot up the popup, otherwise not.

best regards,

sebastian mohrenstecher
executive secretary
net::allies

www.net-allies.de
info@net-allies.de

Report
Re: detecting that browser BACK button was clicked Posted by bgibby on 23 Oct 2002 at 7:51 PM
: i need to create a script that will popup an ad. the user WILL NOT get the ad if they click on the browsers BACK button or CLOSE the browser w/ the little upperright X box.
:
: in IE i've found a way to detect it by using screenX & Y's.
:
: But i have not found a way to detect that the user has clicked the BACK button on NS. has anyone ever done this before? thx.
:

Hi there,

I can guarantee that there is NO possible way to detect that the back button was clicked in any browser. You can have onUnLoad events but that's re-active to the click rather than being able to trap and handle the event yourself, then possibly cancel the event from bubbling up to the browser itself.

You can try going full screen to remove the back button but if your user right clicks and selects back or does the ALT-LEFT combination it overrides what you've already done.

There's just no easy way to control the back button.

Sorry
Bradley q:)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.