Closed Thread Icon

Preserved Topic: detect if window already open Pages that link to <a href="https://ozoneasylum.com/backlink?for=17945" title="Pages that link to Preserved Topic: detect if window already open" rel="nofollow" >Preserved Topic: detect if window already open\

 
Author Thread
JakeB
Paranoid (IV) Inmate

From: us
Insane since: Oct 2000

posted posted 05-04-2001 01:11

i make a new window with this

popupWin = window.open('about:blank', 'myWnd','menubar,toolbar,location,directories,status,scrollbars,resizable,dependent,width=800,height=600');

to check if it's already open i try this, but it doesn't work

if(myWnd){
alert('open');
}

if i replace myWnd with popupWin it still doesn't work

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 05-04-2001 05:41

If it's open, the window.open call won't open another one, it'll use the open one of that name.

So why do you want to check?

JakeB
Paranoid (IV) Inmate

From: us
Insane since: Oct 2000

posted posted 05-04-2001 06:03

because when i click a new link, the window then turns white and does nothing

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 05-04-2001 16:47

Ha ha, I just read your actual code! It turns white and does nothing because that's what you programmed!!

Change
popupWin = window.open('about:blank', 'myWnd','menubar,toolbar,location,directories,status,scrollbars,resizable,dependent,width=800,height=600');

to
popupWin = window.open('http://someplace.org/something/cool/', 'myWnd','menubar,toolbar,location,directories,status,scrollbars,resizable,dependent,width=800,height=600');


JakeB
Paranoid (IV) Inmate

From: us
Insane since: Oct 2000

posted posted 05-04-2001 16:58

i didn't post all the code, heres the whole thing:

function openS(picName, picDesc) {
popupWin = window.open('about:blank', 'myWnd','menubar,toolbar,location,directories,status,scrollbars,resizable,dependent,width=800,height=600');
popupWin.document.write('<html><head><title>Sketch - '+picName+'</title><LINK REL="stylesheet" HREF="style.css" TYPE="text/css"></head><body><p><table border="0" cellspacing="0" cellpadding="0" align="center"><tr><td valign="bottom"><a href="javascript:window.close();"><img src="Img/closewnd.gif" border="0"></a> made by <a href="mailto:jakejake55@hotmail.com">JakeB</a><br>Description: '+picDesc+'</td></tr><tr><td valign="top"><br><img src="'+picName+'" alt="'+picDesc+'"></td></tr></table></p></body></html>');
popupWin.document.close();
}

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 05-04-2001 21:41

popupWin.document.write

wants to be

myWnd.document.write

if I'm not mistaken.

JakeB
Paranoid (IV) Inmate

From: us
Insane since: Oct 2000

posted posted 05-05-2001 01:35

that's not it, i tried it and it doesn't even show the first link you click on.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 05-05-2001 01:53

give us a URL to look at!




JakeB
Paranoid (IV) Inmate

From: us
Insane since: Oct 2000

posted posted 05-05-2001 02:34

http://www.jakeb.f2s.com/art.html

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 05-05-2001 10:00

Heh, everything works fine for me. First, I click on one link and get the popup, then I click on the same link again and also get the same page (it doesn't get wiped out). Anyway, the thing that might causing the problem is that "about:blank" url that you specified. When dynamically creating popups, you don't even need to specify first parameter, so you can leave it blank "" ...

« BackwardsOnwards »

Show Forum Drop Down Menu