Forum Moderators: open

Message Too Old, No Replies

location.pathname & Netscape

doesn't work if location.pathname doesn't exist

         

patric

5:59 pm on Dec 9, 2001 (gmt 0)

10+ Year Member



Hi Everyone, hope you are having a great weekend.

Netscape is almost giving me gray hair (could be my poor Javascript skills too :) ).
What I'm trying to do is to see if my popup exists with javascript. It works really well under IE, but not NS. I swear, it was working before but I don't know what happened =)

// Open up an empty window, if it exists it doesn't do anything to it
MyBlur = window.open('','TheBlur','toolbar=0,menubar=0,scrollbars=0,status=0,width=1,height=1,resizable=1,screenX=0,screenY=0,left=0,top=0');
MyBlur.blur();

if (MyBlur.location.pathname != "/popup/blur.html") {
MyBlur = open('http://domain.com/popup/blur.html','TheBlur','toolbar=0,menubar=0,scrollbars=0,status=0,width=1,height=1,resizable=1,screenX=0,screenY=0,left=0,top=0');
MyBlur.blur();
self.focus();
}

It bails out on the MyBlur.location.pathname. I also tried....
if (typeof MyBlur.location.pathname == "undefined")
but that didn't work either. Plus a bunch of other combinations, no luck.

Anyone that has any great ideas?

Take care,

Patric

ggrot

6:23 pm on Dec 9, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try:

if (MyBlur.location.pathname != "/popup/blur.html") {
MyBlur = open('http://domain.com/popup/ blur.html','TheBlur','toolbar=0,menubar=0,scrollbars=0,status=0,width=1,height=1,resizable=1,screenX=0,screenY=0,left=0,top=0');
MyBlur.blur();
self.focus();
}
else
{ alert(MyBlur.location.pathname); }

and see if your pathname is correct for netscape.

patric

6:40 pm on Dec 9, 2001 (gmt 0)

10+ Year Member



no alert comes up. It doesn't seem to do anything after the MyBlur.location.pathname line.
I made a small test

var test=0;

test=1;
var loc=MyBlur.location.pathname;
test=2;

then a document.write(test) in the body, it printed "1".

Really odd.