View Full Version : window.location in ie
dremmers
11-13-2002, 11:40 AM
When my ie users use a window.locaton link, they lose their button and address bars. This does not happen with Netscape and Mozilla users.
Does anyone have any idea why this is happening and what I can do to correct it?
The code is simply:
function pickRandom() {
window.location = "http://www.mylifestory.org/cgi-bin/rand_link.pl";
}
Thanks.
x_goose_x
11-13-2002, 12:45 PM
Works fine for me!?
beetle
11-13-2002, 03:01 PM
This topic has been debated here before. I always think it's best to use the href property of the location object. Try this and see if it works any better...
window.location.href = "http://www.mylifestory.org/cgi-bin/rand_link.pl";
dremmers
11-13-2002, 03:30 PM
OOOPPPPSSSS!!!!!
Correction. My problem is not with window.location...it's with window.open.
Here is the code:
function goToURL() { window.open ('http://www.mylifestory.org/cgi-bin/rand_link.pl'); }
The problem is the same as described above...only ie users lose their button and address bars.
So sorry for the mispost!
beetle
11-13-2002, 04:00 PM
Oh, do this
window.open ('http://www.mylifestory.org/cgi-bin/rand_link.pl','_blank');
dremmers
11-13-2002, 07:43 PM
Nope. Same problem. No button and address bar.
The only difference is that for a split second the page title reads "_blank" before the real title pops in.
I know there is a way to SUPRESS the button bars (like in a pop-up), but is that JS? I don't know how to do it. It seems like it should work the same way to specifically include them (or at least pick up the user's defaults?).
boggly
11-13-2002, 09:04 PM
Yes, just include toolbar=yes and menubar=yes seperated by a comma in the last argument of the window.open() method. You can also specify other options as well.
Regards,
boggly
beetle
11-13-2002, 09:29 PM
Originally posted by dremmers
Nope. Same problem. No button and address bar.That's odd. EVERY time I use this method (targeting _blank) it works just fine. Can you show me your page online?
BTW, window.open DOES create a 'popup'.
dremmers
11-13-2002, 09:53 PM
Originally posted by boggly
Yes, just include toolbar=yes and menubar=yes seperated by a comma in the last argument of the window.open() method. You can also specify other options as well.
Regards,
boggly
I'm sorry, boggly, you'll have to excuse me for being so dense, but...what?????
I tried:
function goToURL() { window.open ('http://www.mylifestory.org/cgi-bin/rand_link.pl',toolbar=yes,menubar=yes); }
But that just inactivates the link. Clearly I don't have the syntax right. Can you spell it out for me?
-------
beetle, here is the URL:
http://www.mylifestory.org
Click "Write My Story" and then click "Select Random Question". Remember, this is only a problem in ie.
Thanks!
Roy Sinclair
11-13-2002, 10:00 PM
Click "Write My Story" and then click "Select Random Question". Remember, this is only a problem in ie.
Windows 200 SP2 IE 6.0 SP1 -- I did that and the popup window was exactly the same (size, features...) as the window I clicked from.
Maybe it's specific to your machine, do you have acces to another system you can try it from yourself?
dremmers
11-14-2002, 01:05 AM
Interesting...
I have tried it on two different machines with the same results...one Mac, one PC/Windows.
I have one more of each I can try...we'll see what happens!
joh6nn
11-14-2002, 01:59 AM
it's working for me, as well.
boggly
11-14-2002, 04:34 AM
The parameters of the widow.open() method are like this:
window.open("file_location.html","name for window","menubar=yes,toolbar=yes");
Regards,
boggly
glenngv
11-14-2002, 05:29 AM
window.open(url) will not remove the toolbars and menubars even without the target parameter.
maybe it's better to post the page online so that we can try it out in our machine.
dremmers
11-14-2002, 12:22 PM
THIS IS NUTS!!!!!!!!
OK, I tested it on my other Mac and had the same problem. I can't get to my other PC until later this morning, but since you guys already replied, I did some testing. And I am about to run screaming over a cliff!
I added the menubar and toolbar parameters with the correct syntax/punctuation and it somewhat helped ie (I got the button bar but not the address bar), but it screwed up netscape (I got the button bar but not the address bar!). I figured I was on the right track so I did some research and found a list of all the parameters I could add. Turns out I needed location=yes, so I added that. Worked great, but now guess what? There was no scrollbar or resize. Argh! It's as if once you start adding parameters, it doesn't know what to do with the ones you don't specify. ARGH!
Anyway, here's what I ended up with, and it seems to be working in both:
window.open ("http://www.mylifestory.org/cgi-bin/rand_link.pl","WriteYourStory","menubar=yes,toolbar=yes,location=yes,scrollbars=yes,resizable=yes,status=yes")
Why I have to spell out all these things, however, is beyond me.
BTW, what is a good resource for a parameter list should I need one in the future? The one I found was part of a tutorial and only listed those for window.open.
Thanks everyone for all your help!
beetle
11-14-2002, 01:35 PM
window.open() @
MSDN (http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp)
mozilla.org (http://www.mozilla.org/docs/dom/domref/dom_window_ref76.html#1019331)
joh6nn
11-14-2002, 02:58 PM
dremmers, the idea has always been that any parameters you don't give, aren't included. makes sense, if you think about it.
however, the idea has also always been, that if you don't include any paramters, then it defaults to a normal window, with all the trimmings.
having looked at your pages, there doesn't seem to be anything that could possibly be interfering with this, and indeed, there isn't, because it's working fine for me and everyone else. therefore, it can only be something common to the machines that you're testing this on.
so, what are the specs of the systems you're testing this on?
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.