Last active
January 25, 2017 18:53
-
-
Save bgantick/d44346094d8b83d843b17f4b3fcb71ad to your computer and use it in GitHub Desktop.
Get param from url
This file contains 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
var qs = (function(a) { | |
if (a === '') return {}; | |
var b = {}; | |
for (var i = 0; i < a.length; ++i) { | |
var p = a[i].split('='); | |
if (p.length != 2) continue; | |
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, ' ')); | |
} | |
return b; | |
})(window.location.search.substr(1).split('&')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment