In article <nc*********************@wagner.videotron.net>,
do**********@yahoo.com enlightened us with...
Hi,
Is anyone know what is the difference between Location.href and
Window.location.href
Thanks you very much:)
Javascript is case-sensitive.
window.location.href
There's a window object.
The window object has a location object as one of its properties.
The location object has href as a property.
As to the difference between the two, the difference comes up when it's not
really
window.location.href
but more like
top.location.href
You see a lot of references say window.location.href when what they really
mean is ANY window object.
So the following would all do different things in a nested frameset depending
on exactly where they executed:
self.location.href="default.html";
top.location.href="default.html";
parent.location.href="default.html";
top.frames[2].location.href="default.html";
top.opener.location.href="default.html"; // only for popup
I believe most browsers infer the window object as self if it isn't
specified, but I don't know that that is guaranteed. I myself always specify
the full window.location.href, JIC.
HTH
--
--
~kaeli~
Do not taunt Happy Fun Ball!
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace