Two Popups on One Click

S

shiva.kodityala

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
 
S

SAM

(e-mail address removed) 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
 
T

Thomas 'PointedEars' Lahn

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,366
Latest member
IanCulpepp

Latest Threads

Top