Skip to content

Instantly share code, notes, and snippets.

@Ahrry
Created February 21, 2012 14:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Ahrry/1876791 to your computer and use it in GitHub Desktop.
onbeforeunload bug
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Conforming XHTML 1.0 Strict Template</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.js"></script>
<script type="text/javascript">
function unloadPage(){
return "dont leave me this way";
}
window.onbeforeunload = unloadPage;
</script>
</head>
<body>
<a href="www.google.co.uk">I'm off to google</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment