日期:2014-05-18 浏览次数:20376 次
<script language="JavaScript"> window.onbeforeunload = function() { 这里open页面 }</script>
------解决方案--------------------
现在浏览器一般都会拦截这个。。
------解决方案--------------------
function close(){
window.location.href(url);
wondow.close();
}
------解决方案--------------------
window.open("xxx.aspx")
------解决方案--------------------
先window.open("XXXX");
然后window.close();
------解决方案--------------------
<asp:buttom runat="server" OnClick="tz" Text="跳转" />
后台
protected void tz(object sender, EventArgs e)
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "", "window.location.href='XXX.aspx'", true);
}
------解决方案--------------------
关闭的时候给个提示倒是可以
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>onbeforeunload</title>
<script type="text/javascript">
window.onbeforeunload = function() {
var a = "OK";
return a;
}
</script>
</head>
<body>
</body>
</html>