A jQuery $.uri() method
Switch branches/tags
Pull request Compare This branch is 102 commits behind websanova:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
inc
README.md
index.html
jquery-uri.js

README.md

$.uri()

A jQuery $.uri() method for quickly parsing a uri.

Examples

http://www.domain.com/path/index.html?query1=test&silly=willy#test=hash&chucky=cheese
$.uri();            // http://www.domain.com/path/index.html?query1=test&silly=willy#test=hash&chucky=cheese
$.uri('domain');    // www.domain.com
$.uri('host');      // domain.com
$.uri('tld');       // com
$.uri('sub');       // www
$.uri('port');      // 80
$.uri('protocol');  // http
$.uri('path');      // /path/index.html
$.uri('file');      // index.html
$.uri('filename');  // index
$.uri('fileext');   // html
$.uri('1');         // path
$.uri('2');         // index.html
$.uri('3');         // (an empty string)
$.uri('-1');        // index.html
$.uri('?');         // query1=test&silly=willy
$.uri('?silly');    // willy
$.uri('?poo');      // (an empty string)
$.uri('#');         // test=hash&chucky=cheese
$.uri('#chucky');   // cheese
$.uri('#poo');      // (an empty string)

Resources

License

MIT licensed

Copyright (C) 2011-2012 Websanova http://www.websanova.com