You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I still can't believe javascript - the f**ing backbone-language of the web - doesn't offer an API for mutating URLs. Browsers (Firefox) don't expose the `Location` object (the structure behind window.location). Yes, one could think of [decomposed IDL attributes](http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#url-decomposition-idl-attributes) as a native URL management library. But it relies on the DOM element <a>, it's slow and doesn't offer any convenienve at all.
17
+
I still can't believe javascript - the f**ing backbone-language of the web - doesn't offer an API for mutating URLs. Browsers (Firefox) don't expose the `Location` object (the structure behind window.location). Yes, one could think of [decomposed IDL attributes](http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#url-decomposition-idl-attributes) as a native URL management library. But it relies on the DOM element <a>, it's slow and doesn't offer any convenienve at all.
18
18
19
19
How about a nice, clean and simple API for mutating URIs:
20
20
@@ -31,17 +31,17 @@ URI.js is here to help with that.
@@ -152,7 +168,7 @@ I built this sucker during Christmas 2011. It was a nice excuse to get away from
152
168
153
169
```
154
170
Quote from java doc:
155
-
A URI is a uniform resource identifier while a URL is a uniform resource locator. Hence every URL is a URI, abstractly speaking, but not every URI is a URL. This is because there is another subcategory of URIs, uniform resource names (URNs), which name resources but do not specify how to locate them. The mailto, news, and isbn URIs shown above are examples of URNs.
171
+
A URI is a uniform resource identifier while a URL is a uniform resource locator. Hence every URL is a URI, abstractly speaking, but not every URI is a URL. This is because there is another subcategory of URIs, uniform resource names (URNs), which name resources but do not specify how to locate them. The mailto, news, and isbn URIs shown above are examples of URNs.
156
172
```
157
173
158
174
URI.js only handles URLs - but since Firefox already used window.URL for some (yet undocumented) MozURLProperty, I named it URI anyways.
@@ -179,7 +195,7 @@ URI.js is published under the [MIT license](http://www.opensource.org/licenses/m
179
195
* Updated Punycode.js to version 0.3.0
180
196
* added edge-case tests ("jim")
181
197
* fixed edge-cases in .protocol(), .port(), .subdomain(), .domain(), .tld(), .filename()
0 commit comments