【发布时间】:2014-07-04 06:11:59
【问题描述】:
当我单击我的应用程序标题中的链接时,它应该会打开一个弹出屏幕,但是当我从另一个页面单击相同的链接时,它会在另一个弹出窗口中打开,即使我没有关闭之前的那个。此问题仅在 IE 中普遍存在,在其他浏览器中不存在。
function popUpForInvoice(url)
{
var csrfName = document.getElementById("csrf").getAttribute("name");
var csrfToken = document.getElementById("csrf").value;
var newUrl = "/ecommerce/mitac/" + url + "&"+ csrfName + "=" + csrfToken;
var left = (screen.width/2)-(550/2);
var top = (screen.height/2)-(550/2);
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE");
if (msie > 0)
window.open(newUrl,'_blank','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=no,width=540,height=600,left ='+left+',top ='+top+'');
else
window.open(newUrl,'about:blank','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=no,width=540,height=600,left ='+left+',top ='+top+'');
}
【问题讨论】:
标签: javascript internet-explorer window.open