I disagree. I want URI to be abstract, to produce strings and be extensible.
One of its uses is altering the window location, but it's not the only one.
I'm eager to implement this:
http://www.maxb.net/scripts/jgcharts/include/demo/

by extending URL. So let's make it happen.

On Sat, Mar 14, 2009 at 1:59 PM, Sebastian Markbåge
<[email protected]>wrote:

>
> One thing we haven't talked about is how this is going to change in
> the newer browsers that implements HTML 5.
>
> The working draft defines "The Location Interface":
> http://dev.w3.org/html5/spec/Overview.html#the-location-interface
>
> IE 8 has already implemented it and can be extended from
> window.Location.prototype:
> http://msdn.microsoft.com/en-us/library/dd347128(VS.85).aspx
>
> So I would say that the current URI/URL should instead be a new native
> called Location and inherit the legacy window.Location. This can then
> be used for URL related manipulation.
>
> I know that you're skeptical about including HTML 5 drafts this early
> but since a lot of work will probably be based on what's in MooTools
> More it's probably a good idea to go for that naming convention
> already.
>
> Then we can have an alternative extensible URI class for multiple
> schemes that may or may not be locations.
>
>
> On 13 Mar, 05:13, Thomas Aylott / subtleGradient
> <[email protected]> wrote:
> > You make a good point.
> > I was actually dealing with some urls today that were really annoying.
> >
> > I had to check the platform and redirect to a different page. That
> > should be pretty easy, but isn't.
> >
> > Give me something that I can use with window.location or a .go() method
> > (of whatever name) and I'm sold. I don't care if it extends string or
> > not. Ideally I wouldn't like the idea of it constantly reparsing a
> > string, but it doesn't really matter to me from an end-user perspective.
> >
> > var url = new URL();
> > // defaults to window.location
> >
> > if (mac) url.set('basename', defaultBasename + '-mac').go();
> > // whatever means the bit at the end of the "path" before the extension
> > if (win) url.set('filename', '').go(); // EG:
> > mydomain.com/dir/index.html -> mydomain.com/dir/
> >
> > Anoyone who can give me something to this effect without forcing me to
> > deal with slashes and file extensions wins a thumbs-up.
> > I don't care about method names or subclassing or whatever. Just give me
> > the goods! :D
> >
> > — Thomas Aylott / SubtleGradient.com
> >
> > Sebastian Markbåge wrote:
> > > To me, the purpose of a URI class is so that we DON'T
> > > have to deal with string manipulation.
> >
> > > Aaron, could you perhaps fill me in on a few concrete URI manipulation
> > > scenarios where it would be more beneficial to have string
> > > functionality?
> >
> > > On Mar 12, 8:06 pm, Thomas Aylott / subtleGradient
> > > <[email protected]>  wrote:
> >
> > >> I think this is best.
> > >> Let's rename URI ->  URL (or even String.URL ideally) and we can spend
> > >> some time doing a "proper" URI class also.
> >
> > >> — Thomas Aylott / SubtleGradient.com
>



-- 
Guillermo Rauch
http://devthought.com

Reply via email to