Skip to content

Instantly share code, notes, and snippets.

@westc
Forked from jlong/uri.js
Last active August 29, 2015 14:02
Show Gist options
  • Save westc/a1845031597dd6645e13 to your computer and use it in GitHub Desktop.
Save westc/a1845031597dd6645e13 to your computer and use it in GitHub Desktop.
Parsing a URL (jPaq Proof Test)
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
console.log(parser.protocol); // => "http:"
console.log(parser.hostname); // => "example.com"
console.log(parser.port); // => "3000"
console.log(parser.pathname); // => "/pathname/"
console.log(parser.search); // => "?search=test"
console.log(parser.hash); // => "#hash"
console.log(parser.host); // => "example.com:3000"
@westc
Copy link
Author

westc commented May 30, 2014

Here is the test that proves that jPaq Proofs accept Gists:
http://proof.jpaq.org/gist/a1845031597dd6645e13?run=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment