Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 692 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 692 Bytes

anchorize

This is a super fast, tiny and solid client-side URL parser.

anchorize.js parses your URL natively without any regular expressions or string operations. Since it uses your browsers built in renderer you will get a quite safe result :)

Installation

bower install anchorize
<script type="text/javascript" src="bower_components/anchorize.js"></script>

Example

var parsed = anchorize('http://bob:[email protected]:1337/sub/path?foo=bar#jumpto');

parsed.protocol; // http
parsed.username; // bob
parsed.password; // secret
parsed.host;     // any.host:1337
parsed.port;     // 1337
parsed.search;   // ?foo=bar
parsed.hash;     // #jumpto