首页 > 其他 > 详细

同名窗口不能重新打开

时间:2017-10-28 12:26:44      阅读:217      评论:0      收藏:0      [点我收藏+]

var globalWin;//全局变量,表示打开的那个窗口对象

 

globalsubmitForm.LaunchWindow = function (sHref, winName, width, height, top, left) {
var windowSettings = ‘status=yes,menubar=no,scrollbars=yes,toolbar=no,resizable=yes,‘;
if (width == 0 && height == 0) {
windowSettings += ‘width=‘ + (screen.width - 12);
windowSettings += ‘, height=‘ + (screen.height - 100);
windowSettings += ‘, top=0, left=0‘;
}
else {
windowSettings += ‘width=‘ + width;
windowSettings += ‘, height=‘ + height;
windowSettings += ‘, top=‘ + top;
windowSettings += ‘, left=‘ + left;
}
if (globalWin == null || globalWin.closed) {
globalWin = window.open(sHref, winName, windowSettings);
globalWin.focus();
}
else {
alert(‘同名窗口已经打开,请先关闭打开的窗口‘);
}
}

同名窗口不能重新打开

原文:http://www.cnblogs.com/LGDD/p/7746396.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!