Skip to content

Instantly share code, notes, and snippets.

@iampeterbanjo
Last active October 2, 2015 11:44
Show Gist options
  • Save iampeterbanjo/8a83075649dafffa6af7 to your computer and use it in GitHub Desktop.
Save iampeterbanjo/8a83075649dafffa6af7 to your computer and use it in GitHub Desktop.
// https://stackoverflow.com/questions/31077319/regex-get-query-string-without-hash
var parseUri = function (uri){
var anchor = document.createElement('a')
;
anchor.href = uri;
return {
protocol: anchor.protocol
, host: anchor.host
, hostname: anchor.hostname
, port: anchor.port
, pathname: anchor.pathname
, search: anchor.search
, hash: anchor.hash
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment