Re: A URL API

> That would be different behavior than what Location and HTMLAnchorElement do; they unescape various componenents. Is the benefit worth the divergence?
>
> As a side note, an out-of-document HTMLAnchorElement already provides most of the functionality of this interface. Things it can't do:
> - Resolve a relative URL against no base at all (probably not very useful since the interface can only represent an absolute URL).
> - Resolve against an arbitrary base (maybe you could do it awkwardly using <base> tag tricks).
> - Read or write the lastPathComponent or origin without further parsing (should origin really be writable? That's kind of weird...)
> - Read search parameters conveniently without parsing.
>
> It might be nice to provide the parts of this that make sense on HTMLAnchorElement and Location, then see if a new interface really pulls its weight.
>

I idea too. I would rather extend "Location" to include these features, so they would be immediately available in links and the location object. And make Location into a constructor "new Location(url, base)"

Received on Sunday, 19 September 2010 22:48:14 UTC