简单实现,启发一下,哈
但是会出提示,没辙!// ===============================================================
// Login.html
// ===============================================================
<html>
<head>
<title>Login</title>
</head> <body>
<input type="button" id="btnLogin" value="Login">
<script language="JavaScript">
<!--
var oLogin = document.getElementById("btnLogin");
oLogin.onclick = function() {
window.open("NewWindow.html");
window.close();
};
//-->
</script>
</body>
</html>// ===============================================================
// NewWindow.html
// ===============================================================
<html>
<head>
<title>New Window</title>
</head> <body>
<h3>New window, the parent has been closed.</h3>
</body>
</html>
但是会出提示,没辙!// ===============================================================
// Login.html
// ===============================================================
<html>
<head>
<title>Login</title>
</head> <body>
<input type="button" id="btnLogin" value="Login">
<script language="JavaScript">
<!--
var oLogin = document.getElementById("btnLogin");
oLogin.onclick = function() {
window.open("NewWindow.html");
window.close();
};
//-->
</script>
</body>
</html>// ===============================================================
// NewWindow.html
// ===============================================================
<html>
<head>
<title>New Window</title>
</head> <body>
<h3>New window, the parent has been closed.</h3>
</body>
</html>
我的登陆页面不能关闭55555
过去看了下源码,摘出来给 LZL@_@K,提示没了,哈注:IE 6 下测试可用。其他浏览器未测试,估计没戏!// ===============================================================
// Login.html
// ===============================================================
<body>
<object id='WebBrowser' width=0px height=0px classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'> </object>
<input type="button" id="btnLogin" value="Login">
<script language="JavaScript">
<!--
var oLogin = document.getElementById("btnLogin");
oLogin.onclick = function() {
window.open("NewWindow.html", "_blank", "toolbar=no,location=no,directories=no,menubar=no,status=yes,resizable=yes,scrollbars=auto");
//window.close();
document.getElementById('WebBrowser').ExecWB(45,1);
};
//-->
</script>
</body>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
function closeWindow(){
var closeButton = document.getElementById('closeButton');
window.opener = null;
window.close();
}
</SCRIPT>
</HEAD><BODY>
<INPUT id = closeButton TYPE="button" value = "close" onclick= closeWindow()>
</BODY>
</HTML>
<script type="text/javascript">
window.parent.opener=null;
window.parent.close();
</script>
这样关闭父窗口时就不会弹出提示框了
谢谢,大家了,问题解决了,应该在登陆页面写上 window.opener=null;window.close();
如果你登录验证失败呢?
楼上的方法实现不了。要在登录页面控制,在弹出登录成功窗口的同时关闭自身,如<input type="button" value="登录" onclick="window.open('Noname10.htm','','height=200, width=300, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,locationno, status=no'); window.opener=null; window.close();">你有没有测试过?我测试了,是可以的
'location=no,status=no,directories=no,'+
'location=no,status=no,resizable=yes,scrollbars=yes');
是不是这一个.打开一个新的面面........没有工具条没有地址栏