有关js中window.close()函数的问题,想请教。 没有。这个提示框出现与否与浏览器设置有关。不过你可以尽量让window.close()关闭window.open()打开的窗口,这种情况通常不会出现提示窗口。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <input type="button" value="关闭" onclick="opener=null;self.close();"> 谢谢,我刚才测试了一下,在window.close()前插入语句opner=null;好像就直接关闭了。 loadingpage...<script language = "javascript">function WO_LS(loadpos, WWidth, WHeight) //Lock Size{ var WLeft = Math.ceil((window.screen.width - WWidth) / 2 ); var WTop = Math.ceil((window.screen.height - WHeight) / 2 ); var features = 'width=' + WWidth + 'px,' + 'height=' + WHeight + 'px,' + 'left=' + WLeft + 'px,' + 'top=' + WTop + 'px,' + 'fullscreen=0, toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=0'; WinOP = window.open(loadpos, "", features); if(!WinOP){ WinOP=window.open(loadpos, "", features); } if(!WinOP){ alert("无法开启新窗口,如果您使用了窗口拦截工具,请先将其暂停使用!"); return false; }else{ WinOP.focus(); window.opener="meizz"; window.close(); }}WO_LS("default.asp",1024,740);</script> 这个问题以前已经讨论过了,你可以搜索下,opener=null只对ie5.5以上才效 //<input type="button" value="关闭" onclick="opener=null;self.close();"> 关于jquery中get方法无法实现效果的疑问 Jquery能实现对文本自动识别么? String.prototype.repeat 关于无限循环,在线等,急需 怎么得到一个表格的第一行的第3列的值? ★关于下拉列表框提交的问题。 javascript中正则表达式截取字符串问题 请问如何用javascript获得访问该网页用户的IP地址? 这个函数是什么意思? 如果左右两个框架,想使只有个滚动条,而且以那个内容多,就依那个,能做到吗? 关于用下拉列表选择样式的问题! 表格的问题
<script language = "javascript">function WO_LS(loadpos, WWidth, WHeight) //Lock Size
{
var WLeft = Math.ceil((window.screen.width - WWidth) / 2 );
var WTop = Math.ceil((window.screen.height - WHeight) / 2 );
var features =
'width=' + WWidth + 'px,' +
'height=' + WHeight + 'px,' +
'left=' + WLeft + 'px,' +
'top=' + WTop + 'px,' +
'fullscreen=0, toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=0';
WinOP = window.open(loadpos, "", features);
if(!WinOP){
WinOP=window.open(loadpos, "", features);
}
if(!WinOP){
alert("无法开启新窗口,如果您使用了窗口拦截工具,请先将其暂停使用!");
return false;
}else{
WinOP.focus();
window.opener="meizz";
window.close();
}
}
WO_LS("default.asp",1024,740);</script>