Help me correct this please

+4 Teemmy Ellorry · November 29, 2014

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.blah.com/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<body onUnload="alert('goodbye');">
bsdhshbhbddvhj
</body>
</head>
</html>


When i tried closing the page it exited without poping out any Java script.

Post a Reply

Replies

Oldest  Newest  Rating
0 Teemmy Ellorry · November 30, 2014
"notepad++"
0 Steven vd_W · November 30, 2014
Where do you edit your code?
0 Teemmy Ellorry · November 30, 2014

<script type="text/javascript">
window.onbeforeunload = confirmExit;
  function confirmExit()
  {
    alert('Goodbye!');
  }
</script>

I tried this, its not working am i even to code this inside the script?
+2 Steven vd_W · November 30, 2014
window.onbeforeunload = confirmExit;
  function confirmExit()
  {
    alert('Goodbye!');
  }

Try this (not sure if it will work)
  • 1

Javascript

107,297 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators