Solved

window.open displays empty window

Posted on 2011-03-21
5
535 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now