Skip to content

Instantly share code, notes, and snippets.

View andyford's full-sized avatar

Andy Ford andyford

View GitHub Profile
@andyford
andyford / uri.js
Last active August 29, 2015 14:03 — forked from jlong/uri.js
/*
* original from: https://gist.github.com/jlong/2428561
*
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"