Jump to content

popup page when browser is closed or visitor navigates to another page.


jasonc

Recommended Posts

you can use the "onunload" javascript event to detect when a user is leaving your site, when the onunload event is triggered, you can trigger a function to create your popup.

 

<head>
<script type="text/javascript">

function popUp(url) {

popup = window.open(url,"name","height=300,width=200");
if(window.focus) {popup.focus()}
return false;
}

</script>
</head>
<body onunload="popUp('popup.hmtl')">

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.