1 replies
Hi,

I am trying to put in an onbeforeunload for one of my sites. I want another window to open underneath as this fires. I can get the confirmation pop up to fire just fine but have no idea how to code the other.

Here is a website that does it.
Make Money Taking Surveys

I am actually looking at doing the exact same thing. When they go to leave I want to offer a discount and have the discount window load underneath so when they choose to stay on the site, they will be at the discount page.

Hope this made sense....
#issue #onbeforeunload #programming
  • Profile picture of the author n7 Studios
    Hi,

    I've recently spent some time with fellow Warrior dougyitbos comphrehensively looking into Javascript onbeforeunload events, so it's certainly something that can be done.

    In your window.onbeforeunload function call, you'd need to firstly include some code to load a different page (usually location.href or similar), and then throw up the blocking alert message, giving the user the option to stay on the current page (Cancel) or leave the site (OK).

    Feel free to PM me with the web site you're looking to put this on, and I'll see if I can help.

    Tim.
    {{ DiscussionBoard.errors[431876].message }}

Trending Topics