Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

window.open displays empty window

Posted on 2011-03-21
5
Medium Priority
?
545 Views
Last Modified: 2012-06-27
Following a Windows Update to their Windows Server 2003 R2 SP2 servers at the weekend, Citrix server users have complained that links (in their browser based app) that previously opened up a new window (via a call to javascript window.open) no longer work. All they see is a new, empty window and the hourglass goes busy, forever.

I have cut down the script to the bare minimum and the problem is constant.

I have also set the browser back to default settings. Plugging the URL straight into a browser works fine.

My HTML.......
<html>
<head>
<script language="JavaScript" src="javascript/popup.js" type="text/JavaScript"></script>
</head>
<body>
<input type='button' onclick="javascript:popUpWindow('http://server/app/pagex.htm')" value="Popup!?" />
</body>
</html>

And the javascript.......
function popUpWindow(URLStr)
{
  try{
     var width = (screen.width*.75)
     var height = (screen.height*.75)
     var left = (screen.width/2) - width/2;
     var top = (screen.height/2) - height/2;
     window.open(URLStr,'popUpWin',                 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
     } catch(e) {alert(e.description);}
}

Open in new window

0
Comment
Question by:touch-base
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35182665
You have a mistake in the code (illegal space before top=).

I would do this:

<a href="http://server/app/pagex.htm" onclick="return popUpWindow(this.href)">Popup!?</a>
<html>
<head>
<script language="JavaScript" src="javascript/popup.js" type="text/javascript"></script>
</head>
<body>
<input type='button' onclick="popUpWindow('http://server/app/pagex.htm')" value="Popup!?" />
</body>
</html>

And the javascript.......
function popUpWindow(URLStr)
{
  try{
     var width = (screen.width*.75)
     var height = (screen.height*.75)
     var left = (screen.width/2) - width/2;
     var top = (screen.height/2) - height/2;
     var w = window.open(URLStr,'popUpWin','scrollbars,resizable,copyhistory,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top);
     if (w) return false;
     alert('Popup blocker active?');
     return true;
  } 
  catch(e) {alert(e.description);}
}

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35182713
0
 
LVL 1

Author Comment

by:touch-base
ID: 35182752
The URL is fine (it's okay when plugged into a browser) and the code (although a hasty cutdown of the original!) works on certain other machines.

Am beginning to point fingers at Actxprxy.dll; I'm closing down for the day but will get back to this...
0
 
LVL 1

Accepted Solution

by:
touch-base earned 0 total points
ID: 35231180
I have discovered that an application upgrade caused problems with 3 DLLs; ole32.dll, actxprxy.dll and ieproxy.dll. Ole32.dll caused the browser problem but once re-registered, all was okay.
0
 
LVL 1

Author Closing Comment

by:touch-base
ID: 35304206
Self diagnosed solution.
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question