October 30, 200917 yr Ok so this is a very easy JavaScript u can use to confirm a logout and if u hit cancel then it will not logout and if you hit ok it will scripts below <script language="JavaScript" type="text/javascript"> function confirmLogout(){ var agree = confirm("Are you sure you wish to logout?"); if(agree){ return true; }else{ return false; } } </script> And an example of how u would use this on a link is <a href="logout.php" onClick="return confirmLogout()">Logout</a> Hope someone finds this JavaScript of mine useful cheers
Create an account or sign in to comment