close window

----------------例子1------------
代码:
close window<script>
close window
close windowwindow.onbeforeunload 
= function() 
close window
{
close windowalert(
"111222");
close window  
var n = window.event.screenX - window.screenLeft;
close window  
var b = n > document.documentElement.scrollWidth-20;
close window  
if(b && window.event.clientY < 0 || window.event.altKey)
close window  
{
close window    window.event.returnValue 
= ""
close window  }

close window}

close window
close window
close window
</script>
close window
<!--   方法2 
close window<script language=javascript>
close windowwindow.onbeforeunload = function()
close window{
close window  if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
close window  {
close window    window.event.returnValue = "";
close window  }
close window}
close window</script>
close window
-->
close window
close window
<!--   方法3
close window如何让IE6.0右上角的“关闭”按钮失效?
close window实例1即可实现。
close window-----------------------------------
close window<script language=javascript>
close windowwindow.onbeforeunload = function()
close window{
close window  if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
close window  {
close window    window.event.returnValue = "";
close window  }
close window}
close window</script>
close window
close window2----------------------
close window没有关闭按扭
close windowwindow.open("","","fullscreen=3")
close window
close window3----------------------
close window屏蔽alt+f4
close windowif (window.event.altKey && k == 115){
close windowreturn false;
close window}
close window将1.复制到WEB页面中任何位置即可。J)育)kI{t育|1WRd%1
close window
close window供教F2络z管.育M软d0
close window
close window络mr5H7I*业.4"s
close windowz教络kt&!va业5$s^:
close window
close windoweQ1x3Ad%l中~DK网NH教dBziNoq$n\+-
close window$@0R中[件rn2w*69
close window
close window
-->
----------------例子2------------
代码:
close window<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
close window
<html>
close window
<head>
close window
<title>Confirm Before Leave</title>
close window
<script language="javascript" type="text/javascript"><!--
close window
var pb_strConfirmCloseMessage;
close window
var pb_blnCloseWindow = false;
close windowpb_strConfirmCloseMessage 
="您真的要离开本页吗?";
close window
function ConfirmClose() {
close windowwindow.event.returnValue 
= pb_strConfirmCloseMessage;
close windowpb_blnCloseWindow 
= true;
close window}

close window
function ShowConfirmClose(blnValue) {
close window
if(blnValue) {
close windowdocument.body.onbeforeunload 
= ConfirmClose;
close window}
 else {
close windowdocument.body.onbeforeunload 
= null;
close window}

close window}

close window
//-->
close window
</script>
close window
</head>
close window
<body onload="ShowConfirmClose(true);">
close window
<input type=button value="提示" onclick="ShowConfirmClose(true);">
close window
<input type=button value="不提示" onclick="ShowConfirmClose(false);">
close window
<input type=button value="测试刷新" onclick="window.location.reload();">
close window
</body>
close window
</html>
----------------例子3------------
代码:
close window<html>   
close window  
<head>   
close window  
<meta   http-equiv="Content-Type"   content="text/html;   charset=iso-8859-1">   
close window  
<OBJECT   id=closes   type="application/x-oleobject"   classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">     
close window  
<param   name="Command"   value="Close">     
close window  
</object>   
close window  
</head>   
close window  
<body>   
close window  
<p   align="center"><font   size="6">   
close window  
<input   type="button"   value="CLOSE"   onclick="closes.Click();">   
close window  
</font></p>   
close window  
</body>   
close window  
</html>
----------------例子4------------
代码:
close window<script language="javascript">
close window  g_blnCheckUnload 
= true;
close window  
function RunOnBeforeUnload() {
close window     
if (g_blnCheckUnload) {window.event.returnValue = 'You will lose any unsaved content';   
close window     }
  
close window  }

close window
</script>
close window
<body  onbeforeunload="RunOnBeforeUnload()">
close window
</body>
close window
本文转自博客园执着的笨蛋的博客,原文链接:close window,如需转载请自行联系原博主。
上一篇:Java Swing中键盘事件的处理


下一篇:WEBGL学习【五】纹理贴图