无状态栏 无工具栏 页面 如果我要关闭一个无状态栏 无工具栏的页面 这样会触发个什么样的事件? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 代码范例(1)<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>浏览器关闭事件代码范例(1)-->刷新有问题</title> </head> <script language="javascript"> function quit() { event.returnValue="do you want to exit the test?"; } </script> <body onbeforeunload="quit()"> hello world! </body> </html>代码范例(2)<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>浏览器关闭事件代码范例(2)-->刷新有问题</title> </head> <script language="javascript"> function window.onunload(){ alert("窗体关闭了!");} </script> <body> hello world! </body> </html>代码范例(3)<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>浏览器关闭事件代码范例(3)-</title> </head> <script language="javascript"> function window.onbeforeunload() { if( event.clientX>document.body.clientWidth && event.clientY<0 || event.altKey ) { window.event.returnValue="确定要退出本页吗?"; }} </script> <body> hello world! </body> </html>以上部分转自http://yzying1980.blog.163.com/blog/static/59788992009320112945677/ 查百度谷歌即可找到答案。 所用关键词:(js 刷新 父)、(js 关闭 浏览器)刷新父页面:window.parent.location.href="父页面请求"; 关闭当前窗口:window.opener=null;window.close(); //ie6window.opener=('','_parent','');window.close(); //ie7//不弹提示窗function closeWindow() { window.opener = null; window.open('', '_self', ''); window.close(); } (上午结贴)毕业设计网站 怎么用在myeclipse中用hibernate映射表? 在struts1.X的property中能不能这样,对象属性.对象属性.对象属性 struts2中在一个类中如何返回"<a></a>"字符串???急!!! struts2 加入json插件 的配置问题 请教JDBC的问题 数据库连接池疑惑 程序问题!为何做成package会出现错误!!!! 关于invoke方法的参数传递和接收的问题? 【讨论】接口开发---盲敲代码和有测试环境下写代码 hibernate一对一关系,弄了一个星期都出不来,大哥么帮个忙吧 birt 文档
代码范例(1)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>浏览器关闭事件代码范例(1)-->刷新有问题</title>
</head>
<script language="javascript">
function quit()
{
event.returnValue="do you want to exit the test?";
}
</script>
<body onbeforeunload="quit()">
hello world!
</body>
</html>
代码范例(2)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>浏览器关闭事件代码范例(2)-->刷新有问题</title>
</head>
<script language="javascript">
function window.onunload()
{
alert("窗体关闭了!");
}
</script>
<body>
hello world!
</body>
</html>
代码范例(3)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>浏览器关闭事件代码范例(3)-</title>
</head>
<script language="javascript">
function window.onbeforeunload()
{
if( event.clientX>document.body.clientWidth && event.clientY<0 || event.altKey )
{
window.event.returnValue="确定要退出本页吗?";
}
}
</script>
<body>
hello world!
</body>
</html>
以上部分转自http://yzying1980.blog.163.com/blog/static/59788992009320112945677/
刷新父页面:window.parent.location.href="父页面请求";
关闭当前窗口:
window.opener=null;window.close(); //ie6
window.opener=('','_parent','');window.close(); //ie7
//不弹提示窗
function closeWindow() {
window.opener = null;
window.open('', '_self', '');
window.close();
}