window.onunload、window.onbeforeunload在下面代码中,怎么没有执行?

dxc2超越 发布于 2014/03/17 17:43
阅读 512
收藏 0
<!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>无标题文档</title>
<script type="text/javascript">
function windemo()
{
var name = window.navigator.appName;
var version = window.navigator.appVersion;
//alert(name+"....."+version);
//window.location.href = "http://www.sina.com.cn";
//上面一行设置地址,按按键后,会跳转到相应的地址
//alert(url);
//var b  = window.confirm("这是什么对话框?");
//alert(b);
/*
for(var x=0;x<100;x++)
{
window.moveBy(20,0);
window.moveBy(0,20);
window.moveBy(0,-20);
window.moveBy(-20,0);
}*/

//var text = window.prompt("我是一个对话框","haha");
//alert(text);

}
function addemo()
{
//window.open("ad.html","_blank","height=400,width=600,location=no,menubar=no,scrollars=no,resizable=no,status=no,toolbar=no");

//window.setTimeout("alert('kk')",3000);
//window.setInterval("alert('iter')",3000);




}
window.onload=function()
{
alert("onload");
}
window.onunload=function()
{
alert("onunload");
}
window.onbeforeunload=function()
{
alert("onbeforeunload");
}
</script>
</head>


<body>
<input type="button" value="演示windows对象" onclick="addemo()" />
</body>
</html>


































加载中
0
ththththht
ththththht
排版不行。
ththththht
ththththht
回复 @dxc2超越 : .................................我是说你应该用一下代码高亮,不然没人愿意看。还有后面一大片空白 是几个意思啊。。。
d
dxc2超越
应该怎么排版呢?
返回顶部
顶部