Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

problem with popup page showing in same browser?



6:34 am on Apr 26, 2001 (gmt 0)

hi everyone,
i have a problem with my site using popup windows... on my main index page i have a link which goes to my personal page with specific dimensions to it! - That works fine - but from that page i want my other pages to pop up in a similar way but it doesn't work like that online. I used the same code as i did for my index page and it works fine offline in my browser, however when i upload it and view it - the pop up window goes in the same window.. if i put "target-_blank" it makes a new window but doesn't find my page.. grrr this is frustrating.. can anyone help.. if so my site is
[teamkitten.com...] and click on the kat2.2 link.
thanks a bunch =^.^=


7:05 am on Apr 26, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Hi kat,

If you want a new window to open, it needs to have a unique name. Your code uses the name "popup" for every popup window, so once that window is open, any further clicks just load a new document into the same window.

So try using a different name for the second popup window and see if that isn't the behavior you are aiming for.


11:01 pm on Apr 29, 2001 (gmt 0)

hey tedster.. thanks for the reply.
i poked and prodded with my site for a while trying to find how to rename it as you said i should give it a unique name but i'm not sure what you mean as i have given them unique names (i thought)in the file name..
Where are you talking about in the html??
This is my code thats not working online...

in the <body>

<a href="javascript:cPop('abouty.html',300,500)" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('tv','','images/about_07.gif',1)">

and this is the head
function cPop(url, wide, high) {window.open(url,"popup",'width=' + wide + ',height=' + high);

is there somewhere in that code where i can rename it??
Can anyone help or have another script i could use that might work so it shows in another browsers..
thanks again for your help tedster...


4:18 am on Apr 30, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

This is the function definition you're currently using:

{window.open(url,"popup",'width=' + wide + ',height=' + high);

It defines several parameters. The second one, "popup", is the name of the window that the function cPop creates -- it's not the name of the HTML file, but the name of the window where that HTML is rendered.

What you need for your situation is a unique window name for each popup. You could pass this name as a parameter as well, just as you pass the url. So try this as the function definition:

function cPop(url, windowname, wide, high) {window.open(url,windowname,'width=' + wide + ',height=' + high);

Then in the body, the link to generate the the popup window will now pass four parameters, like this:

<a href="javascript:cPop('abouty.html','win001',300,500)">Click for popup window</a>

Here, win001 is the name of this particular window. For the next link you would use win002 (or any set of unique names you want). This way, each HTML document also gets a unique window.

Hope that helps to clarify what I was saying, and good luck! For clarity's sake I omitted your rollover functionality, but this won't affect anything about the popup window when you include it.


5:07 am on May 4, 2001 (gmt 0)

hey tedster,
thanks again for you help... that made things a lot more clearer...
i did the changes as you said... and gave the new windows a name.. but alas.. i STILL can't get this thing to open in a new browser.. this is frustration city here.. !!!!!
any more tips??
.......anyone pwease??
thanks again..


6:36 am on May 4, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

I just checked your revised site.

You've changed the cPop function as we discussed above, but in the BODY section, when you use cPop in a javascript link, you must include FOUR parameters in the link:

1. URL to load in the popup
2. Unique name for the popup window
3. Width of the new window
4. Height of the window

The links you currently have online don't including a window name. They have only parameters 1,3,4.

Hope that helps.


8:25 pm on May 5, 2001 (gmt 0)

For the popup-impaired, you might try this do-hickey...



Featured Threads

Hot Threads This Week

Hot Threads This Month