detecting that browser BACK button was clicked - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

detecting that browser BACK button was clicked

clk0893clk0893 Posts: 1Member
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.

Comments

  • SouldrinkerSouldrinker Posts: 143Member
    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
    [email protected]

  • bgibbybgibby Posts: 251Member
    : 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:)
Sign In or Register to comment.