Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1580
  • Last Modified:

window.open size parameters ignored in IE9

We are using code that has worked for years on all other browsers and platforms, to open a new window in javascript using the traditional windows.open() function.  ()see code snippet).

However, this code does not work in IE9. The new window opens in full screen, we are unable to get it to open using smaller dimensions that we pass to the function.

Has anyone else run into problems with window.open in IE9? Any thoughts?

Thanks experts!
var popUpLinkWin=0;
//****************************************************
// popUpLinkWindow
// optional arguments: width,height,left,top
//****************************************************
function popUpLinkWindow(url)
{
  	if(popUpLinkWin)
  	{
    	if(!popUpLinkWin.closed) popUpLinkWin.close();
  	}
	
	var nWidth=600;
	var nHeight=400;
	var nLeft=10;
	var nTop=10;
	
	if (popUpLinkWindow.arguments.length > 1)
	{
		nWidth = parseInt(popUpLinkWindow.arguments[1])
	}
	if (popUpLinkWindow.arguments.length > 2)
	{
		nHeight = parseInt(popUpLinkWindow.arguments[2])
	}
	if (popUpLinkWindow.arguments.length > 3)
	{
		nLeft = parseInt(popUpLinkWindow.arguments[3])
	}
	if (popUpLinkWindow.arguments.length > 4)
	{
		nTop = parseInt(popUpLinkWindow.arguments[4])
	}
	
	popUpLinkWin = open(url, 'link', 'height=' + nHeight + ',width=' + nWidth + ',left=' + nLeft + ',top=' + nTop + ',toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,directories=yes,status=yes');
	popUpLinkWin.focus();
	return popUpLinkWin;
}

Open in new window

0
rascal
Asked:
rascal
  • 3
1 Solution
 
rascalAuthor Commented:
Found the problem: scrollbars=yes

If we changed it to scrollbars=no then the sizing dimensions work. Thanks Microsoft for another quality product. You are the new IBM.
0
 
rascalAuthor Commented:
I found the solution myself.
0
 
rascalAuthor Commented:
FOLLOWUP: Changing the scrollbars=yes to scrollbars=1 also fixes the problem.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now