<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window对象</title>
<script type="text/javascript">
function win()
{
window.open('http://www.wyu.edu.cn','_blank','width=600,height=400');
}
//alert("欢迎来到五邑大学!");
</script>
</head>
<body>
<form>
<input type="button" value="点击我,打开新窗口" onClick="win()" />
</form>
</body>
</html>因为没有alert()单独时,总是弹出警告窗口,非常麻烦,就是如何能够好地实现alert()的调用,而又不会使其经常弹出,只有当点击的时候;当然,除了放在函数里面,通过按钮点击调用这种方法,还有其他的方法吗?
alert 只有需要才写,不用的话可以注释掉,也可以用document.write() 函数,或者 可以在F12 debug 工具里面调试你要调试的值