Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A jQuery $.uri() method

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 inc
Octocat-spinner-32 README.md
Octocat-spinner-32 index.html
Octocat-spinner-32 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

Something went wrong with that request. Please try again.