I’m working on an application where the client requires us to pop-up a survey page when the user leaves their website (either by going to another page or closing the browser).
The developers before me had used the onUnload event in the <body> tag to do this:
<head>
<script language=”JavaScript”>
function openSurvey()
{
window.open(“
}
</script>
</head>
<body … onUnload=”openSurvey()”>
…
I’ve been told not to use onUnload to do this and for whatever reason it seems this only works in IE. My test page in NS 7, 8 and Firefox all fail to display the pop-up window.
What’s the appropriate way to do something like this that’s cross-browser compatible.
Thanks
Curt