By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,077 Members | 2,160 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,077 IT Pros & Developers. It's quick & easy.

Two Popups on One Click

P: n/a
On click of a button on one page, I would like to activate a popup2-
url. However, popup2 needs another url, popup1-url completely loaded.

That means, I have to do two popups. popup2-url after completely
loading popup1-url. Is there any way to know if popup1-url is totally
loaded.

Thanks
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
SAM
sh*************@gmail.com a écrit :
On click of a button on one page, I would like to activate a popup2-
url. However, popup2 needs another url, popup1-url completely loaded.

That means, I have to do two popups. popup2-url after completely
loading popup1-url. Is there any way to know if popup1-url is totally
loaded.
I think no.

But you can have your 1st popup that opens the 2nd when it's loaded

<body onload="opener.popup2(url2);" blah >

with the 2nd popup's function in main page's JS

In fact you probably can get the mother which launches the 2nd popup.

function pop1(url1, url2) {
if(typeof pop1 == 'undefined' || pop1.closed)
pop1=window.open('','','width=300,height=300,left= 10');
pop1.onload = function(){opener.pop2(url2);};
pop1.location = url1;
pop1.focus();
}
function pop2(url) {
if(typeof pop2 == 'undefined' || pop2.closed)
pop2=window.open('','','width=300,height=300,left= 350');
pop2.location = url;
pop2.focus();
}

not tested

--
sm
Jun 27 '08 #2

P: n/a
sh*************@gmail.com wrote:
On click of a button on one page, I would like to activate a popup2-
url. However, popup2 needs another url, popup1-url completely loaded.

That means, I have to do two popups. popup2-url after completely
loading popup1-url. Is there any way to know if popup1-url is totally
loaded.
1. Don't.

2. This can be facilitated easily with calling window.open() (best
indirectly, with feature test) from the `onload' attribute of the
`body' element of the first popup window. However, popup blockers
are specifically designed to block such unrequested popups, and
they are built into many windowed user agents nowadays.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.