hello
i'v got a problem with th onunload event testing script
it must fires only with the window onunload
but it fires with load either .... why ?
there's somthing wrong i don't know what it is ...
please help
here is th html code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function hello(){alert("welcome to my page");}
</script>
<script type="application/javascript" src="script.js"></script>
</head>
<body onload="hello()" >
</body>
</html>
and here's the script code
window.onunload = goodbye();
function goodbye(){
alert("Thank you for visiting.come back soon!");
}
//window.addEventListener('unload',goodbye(),false);
i've tried the inline calling with body tag , the window.onunload calling and the lestiner calling
nothing works right
please help coz i'm a new
thnx