Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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
    info@net-allies.de

  • 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.