# Java script new window pop-up prb

**URL:** <https://forum.kirupa.com/t/java-script-new-window-pop-up-prb/111452>\
**Category:** Uncategorized\
**Created:** [May 27, 2004, 1:16am UTC](https://forum.kirupa.com/t/java-script-new-window-pop-up-prb/111452 "2004-05-27T01:16:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arman](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@Arman](https://forum.kirupa.com/u/Arman)\
**Post date:** [May 27, 2004, 1:16am UTC](https://forum.kirupa.com/t/java-script-new-window-pop-up-prb/111452/1 "2004-05-27T01:16:31Z")

</div>

I have been using the script from this tutorial:  
[http://www.kirupa.com/developer/mx/centered\_popup.htm](http://www.kirupa.com/developer/mx/centered_popup.htm)  
and also another java script from code generator’s site.

Here is the problem iam having:

I have a webpage ([geocities.com/mypage](http://geocities.com/mypage)) and iam using a short/fast URL redirect.  
The code works fine, window pop-ups in the centre, all works great when i brows my page directly (using [geocities.com/mypage](http://geocities.com/mypage)), however when i use the URL redirect (takeme.to/mypage), clicking on the button to open the centred pop-up window, nothing happens.

After a week i managed to find out the problem wasnt with how i used the action script, but with the URL redirect. (maybe conflicts with the code or something).

Is there a fix to my problem or should give up the short URL redirect ?

Here is the other code iam using:

on (release) {  
getURL (“javascript:NewWindow=window.open(‘URL’,‘WinName’,‘width=400,height=300,left=200,top=100,toolbar=Yes,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No’); NewWindow.focus(); void(0);”);  
}

Thanks in advance,  
Arman

---

<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:** [May 27, 2004, 5:48pm UTC](https://forum.kirupa.com/t/java-script-new-window-pop-up-prb/111452/2 "2004-05-27T17:48:40Z")

</div>

that aint javascript - its actionscript  
javascript for a popup window is as follows:

\<script language=“JavaScript”\>  
function popUpFlash() {  
open(“Mag1.swf”, “FlashWindow”, “left=25, top = 100, width=750,height=400,title=Flash”)  
}  
\</script\>  
and then u just call the function popIpFlash() as an on click event…  
note u wanna change “Mag1.swf” to the url of your page  
left is how many pixels the window opens from the left  
top is how many pixels the window opens from the top  
width and height are self explanatory…  
“FlashWindow” is the name of the window (in case you wanna change content later)  
title should be what is displayed as its title… if memory serves…  
as far as i know, if you want it centered youll have to do sumit like ive done before below:

\<script language=“JavaScript”\>  
function popUpFlash() {  
if (screen.availWidth == 800){  
open(“Mag1.swf”, “FlashWindow”, “left=25, top = 100, width=750,height=400,title=Flash”)  
}  
if (screen.availWidth == 1024){  
open(“Mag1.swf”, “FlashWindow”, “left=137, top = 184, width=750,height=400,title=Flash”)  
}  
if (screen.availWidth \< 750){  
alert("Your Screen size is limiting your experience!  
This site was intended to be viewed at a higher screen resolution.  
The page will load regardless, but for the full effect, please view on a larger monitor,

Thank you,  
Cold Phoenix")  
open(“Mag1.swf”, “FlashWindow”, “resizable, scrollable, left=0, width=750,height=400,title=Flash”)  
}  
if (screen.availWidth == 1152){  
open(“Mag1.swf”, “FlashWindow”, “left=201, top = 232, width=750,height=400,title=Flash”)  
}  
if (screen.availWidth == 1280){  
open(“Mag1.swf”, “FlashWindow”, “left=265, top = 236, width=750,height=400,title=Flash”)  
}  
if (screen.availWidth == 1360){  
open(“Mag1.swf”, “FlashWindow”, “left=305, top = 184, width=750,height=400,title=Flash”)  
}  
if (screen.availWidth \> 1360){  
alert("This site was intended for viewing on smaller monitors and as such you may not experience the full effect.  
The site will still be displayed regardless and apologies for any inconveniance,

Thank you,  
Cold Phoenix")  
open(“Mag1.swf”, “FlashWindow”, “width=750,height=400,title=Flash”)  
}  
}  
\</script\>

enjoy 😉

Prophet.
