Monday, April 28, 2014

Stop a page from exit with jQuery and open window on close parent window

<!DOCTYPE html>
<html>
<head>
<title>Refresh a page in jQuery</title>

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>

</head>

<body>

<h1>Stop a page from exit with jQuery</h1>
<script type="text/javascript">

$(window).bind('beforeunload', function(){
window.open('http://www.google.com','GoogleWindow', 800, 600);
return '>>>>>Before You Go<<<<<<<< \n Your custom message go here';
});

</script>

</body>
</html>

No comments:

Post a Comment