Skip to content Skip to sidebar Skip to footer

Is It Possible For Onunload Confirm To Open A New Url In The Same Window?

this is my first post and I'm a JS novice, so please forgive my ignorance... Heres my question, its in two parts: 1.) At onunload I want an alert that asks the user if they would l

Solution 1:

  • If there would be a way to bypass the pop-up blocker it would be a bad pop-up blocker.
  • As far as I know you need a popup, because when onUnload is executed, the original window might be already closed.
  • Yes, you can move it to the script part:

    function confirmit() { var closeit= confirm("Before you go would you like to add your press kit to the Search Press Kits database?"); if (closeit == true) {window.open("http://NEWURLHERE.com");} else {window.close();} } window.onunload = confirmit

Post a Comment for "Is It Possible For Onunload Confirm To Open A New Url In The Same Window?"