Hi - 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 like to go to a related URL. The code I'm using works, but it open the URL in a new window and this can be blocked by a pop-up blocker even though the user has opted-in. Is there a way to have it open in the same window and negate the pop-up blocker?
2.) is there a way to take the onunload function out of the body tag and put it the script?
Heres the code I'm using:
<script language=javascript>
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();}
}
</script>
</head>
<body onunload="confirmit();">
peace
</body>
Thanks in advance,
Dan