不准点击X来关闭当前网页
<script language=javascript>
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";
new ActiveXObject("WScript.Shell").sendKeys("{ESC}")}
}
</script><input type=button value=关闭 onclick="window.opener=null;window.close()">
<!-- IE5.5以上不会有弹出提示 -->
<script language=javascript>
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";
new ActiveXObject("WScript.Shell").sendKeys("{ESC}")}
}
</script><input type=button value=关闭 onclick="window.opener=null;window.close()">
<!-- IE5.5以上不会有弹出提示 -->
解决方案 »
- Easyui datagrid 绑定键盘上下键操作选中行的问题
- 百分求一段代码,做了好久做不好哪位同学帮帮忙
- getElementBy正則對象....要怎麼寫?
- 45分啦,我新手,这个验证函数怎么调用
- html页面中用了大量的javascript脚本,造成阅读页面很困难,有什么办法能让javascript脚本隐藏起来?
- csdn论坛头像上面的特效:鼠标移动到头像弹出div已经做好了··但是怎么控制弹出div的位置呀···
- 延时问题!
- 请问简单问题
- 一个很菜的关于Javascript的问题.
- 代码怎么未被执行
- 弹出的窗体怎么更改原窗体的一个值?急!!!!!!!!!!!!谢先了!
- <a href ="1.asp"></a>我要已这种形式提交文本框内容就如何写?
<textarea id=xxcode style='width:100%;height:100%'>
<textarea style='display:none' name=xxabout>
Freeonline[Version5],Copyright(C)2003,Bxxxr
本程序是自由软件,遵循GPL,没有任何担保。详细情况请参阅GNU通用公共许可证。http://www.gnu.org/
本程序是用JavaScript在网吧里写的。(98SE IE5 CR1G 128M)它的基本用途是在线编写脚本程序,还有一些小功能。
Email:[email protected]
</textarea>
<script>
function window::onbeforeunload(){
if (event.clientY<0 && event.clientX>document.body.clientWidth-20
|| event.clientY<0 && event.clientX<20
|| event.altKey
|| event.clientY>document.body.clientHeight)
event.returnValue='Exit freeonline ?'
}function window.onload()
{
document.title=xxabout.value
self.moveTo(0,-4)
self.resizeTo(screen.availWidth+4,screen.availHeight+8)
xxcodearea.select()
xxywj.value=window.location.href
xxdiv.style.visibility="hidden"
}function xxrun()
{
xxwww=xxcodearea.value;
xxrrr=open('','','');
xxrrr.document.open();
xxrrr.document.write(xxwww);
xxrrr.document.close();
}
</SCRIPT><body bgcolor=menu style=border:none scroll=no topmargin=0 leftmargin=0
onkeydown="if((event.ctrlKey&&event.keyCode==13)||event.keyCode==116){event.keyCode=0;event.returnValue=false;xxrun();}"><TEXTAREA name=xxcodearea wrap=off
oncontextmenu='window.event.returnValue=false;xxdiv.style.visibility="visible";'
style="background-color:#f3f0fb;
color:#ae34f8;
border:#ae34f8 solid 0px;
font-weight:bolder;
width:100%;
height:100%;
overflow:auto">
</TEXTAREA><DIV ID=xxdiv
oncontextmenu='window.event.returnValue=false;xxdiv.style.visibility="hidden";'
style="background-color:menu;
filter:alpha(opacity=60);
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
overflow:auto;">
<input onclick='xxdiv.style.visibility="hidden";xxrun();' type=button value="运行"><p>
<input onclick='xxdiv.style.visibility="hidden"' type=button value="编辑">
<input type="text" value="http://" name="xxywj" size="20">
<input onclick='xxdiv.style.visibility="hidden";window.location="view-source:"+xxywj.value;' type="button" value='源文件'>
<FORM style="display:inline" action="file:///c|/My Documents/" method=get target=_blank>
<input onclick='xxdiv.style.visibility="hidden"' type="submit" value='我的文档'></FORM>
<input onclick='xxdiv.style.visibility="hidden";alert(xxabout.value);' type=button value='关于'>
</DIV></body>
</textarea>
<!------------------------------>
<object
id=xxclose
type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object><SCRIPT>
function window.onload()
{
xxclose.Click()
var xxclone=window.open("","","resizable=1,status=1")
xxclone.document.open()
xxclone.document.write(xxcode.value)
xxclone.document.close()
}
</SCRIPT>
机器要重启,先放一下