Skip to content

Instantly share code, notes, and snippets.

View hultberg's full-sized avatar

Edvin Hultberg hultberg

View GitHub Profile
@hultberg
hultberg / uri.js
Created August 25, 2014 09:09 — forked from jlong/uri.js
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"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"