> Is there a w3c compliant substitute for window.location?
> I don't need the full functionality of the location
> object; just the ability of getting the URL (including
> the search field).
document.URL
allows you to retrieve the absolute address to the document as a simple
string. IE will allow you to assign to it (and some others might, too),
but it's defined as read-only.
Mike

Signature
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
> Is there a w3c compliant substitute for window.location?
> I don't need the full functionality of the location
> object; just the ability of getting the URL (including
> the search field).
Well the window object is not part of the W3C DOM specification, indeed
that has tried to abstract from user agents. As long as you are
scripting HTML document in browsers there is nothing wrong with using
window
window.document
window.location
I don't see that as not being W3C compliant only because the W3C hasn't
had any interest to standardize that stuff.
SVG 1.2 which is more something like web application tries to
standardize a global object, see
http://www.w3.org/TR/SVG12/api.html#GlobalObject
but I don't think that helps in any way when scripting HTML documents.

Signature
Martin Honnen
http://JavaScript.FAQTs.com/
Jim Ley - 28 Nov 2004 11:11 GMT
>I don't see that as not being W3C compliant only because the W3C hasn't
>had any interest to standardize that stuff.
They'll likely be a web-application working group coming along soon,
they may or may not standardise some of the legacy stuff.
Jim.
David M. Gauntt - 30 Nov 2004 18:11 GMT
It looks like I may as well keep using window.location. I haven't run
into a browser that doesn't use it, and since document.URL is
read-only, it does't help.
Thanks for the replies!
- David Gauntt