# Open new window doesn't work in IE

**URL:** <https://forum.kirupa.com/t/open-new-window-doesnt-work-in-ie/42568>\
**Category:** Uncategorized\
**Created:** [February 10, 2004, 2:35pm UTC](https://forum.kirupa.com/t/open-new-window-doesnt-work-in-ie/42568 "2004-02-10T14:35:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kathari](https://avatars.discourse-cdn.com/v4/letter/k/a183cd/32.png) [@kathari](https://forum.kirupa.com/u/kathari)\
**Post date:** [February 10, 2004, 2:35pm UTC](https://forum.kirupa.com/t/open-new-window-doesnt-work-in-ie/42568/1 "2004-02-10T14:35:27Z")

</div>

Hi  
I am aware parts of this question have been an issue on this site before but I have tried a script that was posted here before and couldn’t make it work…  
i have a page with a small swf-file that should open up a new window with my main site(a flash site) with javascript. It only works in Netscape and Safari, not in Explorer. i am on Mac and I haven’t had achance to test it on PC yet.  
Here is the code:  
[AS]open\_mc.onEnterFrame = function() {  
getURL(“javascript:openWindow(‘artsc.html’,’:::ART SCENICK.NU:::’, ‘toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width=700, height=376’, top=0, left=0)”);  
delete this.onEnterFrame;  
};  
[/AS]

and in the html I have:  
\<SCRIPT LANUGAGE=“javascript”\>

\<!–  
function openWindow(URL, windowName, windowProperties){  
newWindow=window.open(URL, windowName, windowProperties);  
}  
–\>

\</SCRIPT\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 10, 2004, 2:39pm UTC](https://forum.kirupa.com/t/open-new-window-doesnt-work-in-ie/42568/2 "2004-02-10T14:39:23Z")

</div>

OOPS,  
lots disappeared… and of course it chould say: getURL(javascript:openWindow etc  
cont.  
this is the code in the html document.  
\<SCRIPT LANUGAGE=“javascript”\>

\<!–  
function openWindow(URL, windowName, windowProperties){  
newWindow=window.open(URL, windowName, windowProperties);  
}  
–\>

\</SCRIPT\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 10, 2004, 2:41pm UTC](https://forum.kirupa.com/t/open-new-window-doesnt-work-in-ie/42568/3 "2004-02-10T14:41:20Z")

</div>

I don’t seem to understand this forum…  
In the html document I just have the regular  
function openwindow(URL, windowName, windowProperties) i don’t seem to be able to post it here for some reasonalso I don’t manage to center the new window. I have tried a script from this site but without success…  
i would be really grateful for help!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 10, 2004, 10:13pm UTC](https://forum.kirupa.com/t/open-new-window-doesnt-work-in-ie/42568/4 "2004-02-10T22:13:13Z")

</div>

OK  
I have found (on this forum) and used a script that works really well to center my new window. THANKS Shane Waldeck!!! However, none of this works in IE 5.2 on my Mac. That is, it doesn’t open a window at all. I have tried changing my onEnterFrame to a release button event in the swf and about a million other useless things in the html document. It is a real problem to me since my client is on Mac AND IE… Can anyone point me to a tutorial or help me with this? I hope I make more sense this time.  
Here is the new code:  
[AS]\<SCRIPT LANUGAGE=“javascript”\>  
\<!–  
function newWin(page,winName,w,h,scrollb,resize) {  
var win=null;  
centerWidth = (screen.width) ? (screen.width-w)/2 : 0;  
centerHeight = (screen.height) ? (screen.height-h)/2 : 0;  
config =  
‘height=’+h+’,width=’+w+’,top=’+centerHeight+’,left=’+centerWidth+’,scrollbars=’+scrollb+’,resizable=’+resize+’’  
win = window.open(page,winName,config);  
}  
–\>  
\</SCRIPT\>  
[/AS]

and on the swf

[AS]on (release) {  
getURL(“javascript:newWin(‘[http://www.lostinbeta.com](http://www.lostinbeta.com)’,‘lostinbeta’,‘300’,‘200’,‘no’,‘no’)”);  
}  
[/AS]

Or can anyone tell me if or how the calculations above (for the positioning of the new window) can be used in Open Browser Window in DreamweaverMX can be done?:jail:
