- From: Maciej Stachowiak <mjs@apple.com>
- Date: Tue, 14 Feb 2006 02:45:17 -0800
- To: Maciej Stachowiak <mjs@apple.com>
- Cc: public-webapi@w3.org
On Feb 14, 2006, at 2:29 AM, Maciej Stachowiak wrote: > interface Location { > // the current URI > readonly attribute DOMString href; > > // pieces of the URI, per the generic URI syntax > readonly attribute DOMString hash; // (fragment) > readonly attribute DOMString host; // hostname:port if port > specified, > readonly attribute DOMString hostname; // just the > hostname, no port > readonly attribute DOMString pathname; > readonly attribute DOMString port; > readonly attribute DOMString protocol; // scheme > readonly attribute DOMString search; // query Anne pointed out that none of these attributes are actually readonly. Assigning a URI string href navigates to that URI. Assigning any of the other attributes disassembles the current URI into components, replaces those pieces and navigates there. Not sure why I wrote readonly. Also probably worth mentioning that navigation caused by location assignment, attribute assignment and methods does not take effect until the current <script> element's script is done executing (or for event handlers afer event processing is done, i.e. at the next "idle" time), but I'm not sure how to write that in a clear and sane way. Regards, Maciej
Received on Tuesday, 14 February 2006 10:45:35 UTC