var newwindow = '';
function popitup(url,target) {
if (!newwindow.closed && newwindow.location) {
newwindow.location.href = url;
}
else {
newwindow=window.open(url,target);
if (!newwindow.opener) newwindow.opener = self;
}
if (window.focus) {newwindow.focus()}
return false;
}
这个方法,只允许弹出一个窗口。点多次,也只弹出一个。很爽的。
PS:不知道从哪看到到这样一个方法,可以关闭浏览器,不给出任何提示。
<INPUT TYPE="button" value="提交" onclick="closeWin();">
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWin(){
window.open("","_self");
top.opener=null;
top.close();
}
//-->
</SCRIPT>