JavaScript中没载体怎样执行方法?

songfuqiang 2008-05-20 05:11:16
window.open('child.html');
我怎么用onUnload="quit()";
执行不到quit()的方法?
...全文
41 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
s_liangchao1s 2008-05-21
  • 打赏
  • 举报
回复

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>a</title>

<script type="text/javascript">
function quit(){
window.location='http://www.163.com';
}
window.onUnload = quit();
</script>
</head>
<body>

</body>
</html>



可以阿 有什么问题
songfuqiang 2008-05-21
  • 打赏
  • 举报
回复
这个我晓得行,但是如果quit()代码为:{window.location='http://www.126.com';}哪就不行了
s_liangchao1s 2008-05-20
  • 打赏
  • 举报
回复

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>a</title>

<script type="text/javascript">
function quit(){
alert("这意思?");
}
window.onUnload = quit();
</script>
</head>
<body>

</body>
</html>


87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧