Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup not working in IE

Status
Not open for further replies.

gmannatl

Technical User
Aug 23, 2003
152
US
I have found a few examples of Java Popups online and have modified the function slightly to be more dynamic with several arguments. The following code seems to work fine with Firefox, but in IE it just routes to the href and the Java onClick is not followed. I have checked my IE settings and Java is enabled and working fine.

<SCRIPT LANGUAGE="JavaScript">
function MyPopUpWin(url, vidName, vidW, vidH) {
var iMyWidth;
var iMyHeight;
//half the screen width minus half the new window width (plus 5 pixel borders).
iMyWidth = (window.screen.width/2) - (vidW / 2 + 10);
//half the screen height minus half the new window height (plus title and status bars).
iMyHeight = (window.screen.height/2) - (vidH / 2 + 10);
//Open the window.
var win2 = window.open(url,vidName,"status=no,height="+ vidH +",width="+vidW+",resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");
if (window.focus) {win2.focus()}
return false;
}
</SCRIPT>


I am calling the script as follows

<a href="popupex.html" onclick="return MyPopUpWin(' Window',1000,500)">Link to popup</a>

Any help is greatly appreciated!!
 
Having a window name with a space in is not allowed AFAIK. Have you tried removing the space, e.g. "TestWindow" instead of "Test Window" ?

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top