Solved

window.open displays empty window

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

776 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