关于JS问题,不知道能不能解决

marco08 2008-02-16 09:29:44


<html>
<head>
<title>第一个页面</title>
</head>
<body>
<form id="form1" name="form1" action="22.htm" method="post" target="_blank">
<input type="submit" value="submit">
</form>
</body>
</html>


<html>
<head>
<title>第二个页面</title>
<script language="javascript">
function closeWin()
{
alert("关闭");
window.close();
//能否先闭窗口,再弹出对话框
}
</script>
</head>
<body>
<form id="form2" name="form2">
<input type="button" value="close" onclick="closeWin()">
</form>
</body>
</html>

==
第二个页面能否先闭窗口,再弹出对话框
...全文
75 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
marco08 2008-02-17
  • 打赏
  • 举报
回复
谢谢各位高手,学习了
  • 打赏
  • 举报
回复
都是厉害的家伙哦!

睡觉去了
昨天2点才睡
起来又早!
你们继续
我脑已经没办法想东西了,指知道睡觉了
  • 打赏
  • 举报
回复

利用了body的onunload这个属性!
一个以延时一个时以关闭后调用属性
xiaolei1982 2008-02-16
  • 打赏
  • 举报
回复
<html>
<head>
<title>第一个页面</title>
</head>
<body>
<form id="form1" name="form1" action="3.asp" method="post" target="_blank">
<input type="submit" value="submit">
</form>

</body>
</html>
<script language="JavaScript">
var bb;
window.onload=function()
{
time=window.setInterval(function(){ if (bb=="true"){alert("关闭");clearInterval(time);}},1000)
}
</script>


<html>
<head>
<title>第二个页面</title>
<script language="javascript">
function closeWin()
{

window.close();
//能否先闭窗口,再弹出对话框
}
</script>
</head>
<body>
<form id="form2" name="form2">
<input type="button" value="close" onclick="window.opener.bb='true';closeWin()">
</form>
</body>
</html>
  • 打赏
  • 举报
回复
哈哈!!!!你够狠的!这样都能可以想出来!
liuyann 2008-02-16
  • 打赏
  • 举报
回复

<html>
<head>
<title>第二个页面</title>
<script language="javascript">
function closeWin()
{
window.close();
//能否先闭窗口,再弹出对话框
}

function showAlert()
{
alert("关闭");
//能否先闭窗口,再弹出对话框
}

</script>
</head>
<body onunload="showAlert();">
<form id="form2" name="form2">
<input type="button" value="close" onclick="closeWin()">
</form>
</body>
</html>
  • 打赏
  • 举报
回复
你自己觉得可能吧??
marco08 2008-02-16
  • 打赏
  • 举报
回复
是这个意思
  • 打赏
  • 举报
回复
汗!不太明白你的意思,你不会是说把第二个页面先关闭再显示第二个页面得alert("关闭");这个窗口吧?

87,910

社区成员

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

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