...

View Full Version : Trouble opening popup in IE on Windows XP



cotec
12-29-2005, 02:54 PM
I have a Flash Application which needs to be in a window that has a size of 1024 x 768, so I've included a javascript to set the popup's size to those dimensions. However, when I try to open the HTML page that has the javascript on a Windows XP computer, the popup window's dimensions aren't changing to those settings.
I forgot to check to see what version of IE this computer has, but I think it is the default version that comes with XP. I used the following lines of code to open the window:

windowW=1024;
windowH=768;
s = "width="+windowW+",height="+windowH;//+",scroll=0";
var isIE = document.all?true:false
if (isIE) {
NW = window.open("","popFrameless",s)
NW.blur();
window.focus();
NW.resizeTo(windowW,windowH)
} else {
NW = window.open("myFile.html", "popFrameless","scrollbars,"+s)
NW.blur();
NW.resizeTo(windowW, windowH)
}

Is there a different way to open a popup to a specific size in XP?

Chris

_Aerospace_Eng_
12-29-2005, 05:19 PM
Your script seems a little complicated for what you want to do. How are you opening this window? With a link?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
<!--
function openWin(url){
if(screen.width<=800){
sw="800";
sh="600";
sbar="1";
}
else {
sw="1024";
sh="768";
sbar="0";
}
newwin=window.open(url,'newwin','width='+sw+',height='+sh+',scrollbars='+sbar+',top=0,left=0,menubar =0,toolbars=0');
}
//-->
</script>
</head>

<body>
<a href="yourflashpage.html" onclick="openWin(this.href);return false">Link to Flash</a>
</body>
</html>

cotec
01-03-2006, 02:54 PM
I have my code running in the onLoad event of another html page.

nikkiH
01-03-2006, 03:52 PM
Do you realize this code will not reliably detect only MSIE and can mess up tabbed browsers such as Opera and Avant Browser?

I don't know if this is for intranet or internet, but that might be an issue for you. Also, MSIE 7 will have tabs. Just FYI. ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum