Created
March 17, 2014 10:33
-
-
Save qborreda/9597099 to your computer and use it in GitHub Desktop.
getQueryParameters get url params from javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* getQueryParameters.js | |
* Copyright (c) 2014 Nicholas Ortenzio | |
* The MIT License (MIT) | |
* | |
*/ | |
window.getQueryParameters = function(str) { | |
return (str || document.location.search).replace(/(^\?)/, '').split("&").map(function(n) { | |
return n = n.split("="), this[n[0]] = n[1], this | |
}.bind({}))[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment