tip and trick‎ > ‎

Don't Leave this page !!!!!

posted Apr 12, 2012, 6:09 AM by mb s
COnfirm Navigation

to  create this confirm VIA jquery ,write this code :

<html>
<head>
<title>Refresh a page in jQuery</title>
 
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
 
</head>
 
<body>
 
<h1>Stop a page from exit with jQuery</h1>
 
<button id="reload">Refresh a Page in jQuery</button>
 
<script type="text/javascript">
 
	$('#reload').click(function() {
 
	 	location.reload();
 
	});
 
	$(window).bind('beforeunload', function(){
		return '>>>>>Before You Go<<<<<<<< \n Your custom message go here';
	});
 
</script>
 
</body>
</html>

View Sample Online

Comments