Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

2 popups at load

Posted on 2003-10-21
6
Medium Priority
?
1,902 Views
Last Modified: 2011-04-14
I am using the following to open a popup when loading the page.
I need to open two separate popups, and need the code for it.
Please note I am not a coder, so I need details, I do understand the pixel size of the window, so don't worry about that.
The second popup is named popup2.html

<script language="Javascript"><!--
function open_on_entrance(url,name)
{
new_window=window.open('http://www.ilbarettoverona.com/popup.html','yahoocom','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,Width=377,height=580,screenX=20,screenY=20,top=40,left=40')
}
// -->
</script>
<link href="style.css" rel="styleSheet" type="text/css">
</head>
<body bgcolor="black" onload="open_on_entrance()">

For few extra can someone tell me why is it that if I don't put the 'yahoocom' on the above code the popup won't load?

Thank you
0
Comment
Question by:keneso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
boro_bob earned 360 total points
ID: 9591373
Try this. Just copy the first new_window line and paste it below, and make the changes. The yahoocom is just a name for the window. The window needs to have a name, but it shouldn't matter what it is. The window names do need to be different though.

<script language="Javascript"><!--
function open_on_entrance(url,name)
{
new_window=window.open('http://www.ilbarettoverona.com/popup.html','yahoocom','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,Width=377,height=580,screenX=20,screenY=20,top=40,left=40')

new_window2=window.open('http://www.ilbarettoverona.com/popup2.html','popup2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,Width=377,height=580,screenX=20,screenY=20,top=50,left=50')
}
// -->
</script>
<link href="style.css" rel="styleSheet" type="text/css">
</head>
0
 
LVL 17

Expert Comment

by:paulop1975
ID: 9591400
I guess you cando ir like this:

<script language="Javascript"><!--
function open_on_entrance(url,name)
{
new_window=window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,Width=377,height=580,screenX=20,screenY=20,top=40,left=40')
}
// -->
</script>
<link href="style.css" rel="styleSheet" type="text/css">
</head>
<body bgcolor="black"
  onload="open_on_entrance('http://www.ilbarettoverona.com/popup.html','yahoocom'); open_on_entrance('popup2.html','Name of the Popup2 window')">

Hope this works and good luck!
:)

Fui (portuguese for "gone")
c(ô.Ô)o

pAul0|PIm3NTA
0
 
LVL 17

Expert Comment

by:paulop1975
ID: 9591415
The way I made the code, you can open any URL (popup window) you which using the sme funtion. That's why functions are so usefull.
;)

Good luck!

Fui (portuguese for "gone")
c(ô.Ô)o

pAul0|PIm3NTA
0
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 
LVL 5

Expert Comment

by:boro_bob
ID: 9591459
If you do it like that Paulop, you are forced to have the windows the exact same size, and appear on top of each other. The way I suggested means that you can set different properties for each window. :)
0
 
LVL 5

Expert Comment

by:boro_bob
ID: 9591460
If you do it like that Paulop, you are forced to have the windows the exact same size, and appear on top of each other. The way I suggested means that you can set different properties for each window. :)
0
 
LVL 7

Author Comment

by:keneso
ID: 9591562
Than you both

I picked boro_bob's cause it was exactly what I wanted.

I had tried copying and pasting, with the change from popup.html to popup2.html,
but it didn't work because I didn't know about the 'name' (yahoocom), the same for both windows.
Now I renamed that too, so it's more clear.
0

Featured Post

Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question