When i click on a link in my application header it should open a pop up screen, but when i click on the same link from someother page it is opening in another pop up even though i had not closed the earlier one. This issue is prevailing only in IE and not in other browsers.
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+'');
}
_blank
as target is DESIGNED to open a new window each timeabout:blank
is not a valid target - use something like mywindow
to reuseThis should work
Remove
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
And just have
window.open(newUrl,'mywindow',
'scrollbars,resizable=no,width=540,height=600,left='+left+',top='+top);
Do note that you will likely need to focus the window or it will stay under when opened the second and subsequent times