Solved

2 popups at load

Posted on 2003-10-21
6
1,895 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
  • 3
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
boro_bob earned 90 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Link to post behind image slider 1 38
Pick image, show data 4 33
Suggestion on WebSite Template Sites 6 58
Hovering effect 9 29
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now