HighDots Forums  

Two Popups on One Click

Javascript JavaScript language (comp.lang.javascript)


Discuss Two Popups on One Click in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shiva.kodityala@gmail.com
 
Posts: n/a

Default Two Popups on One Click - 06-11-2008 , 07:42 PM






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

Reply With Quote
  #2  
Old   
SAM
 
Posts: n/a

Default Re: Two Popups on One Click - 06-11-2008 , 08:51 PM






shiva.kodityala (AT) gmail (DOT) com a écrit :
Quote:
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


Reply With Quote
  #3  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Two Popups on One Click - 06-13-2008 , 02:04 PM



shiva.kodityala (AT) gmail (DOT) com wrote:
Quote:
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, <f806at$ail$1$8300dec7 (AT) news (DOT) demon.co.uk>


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.