Created
February 9, 2015 17:25
-
-
Save aroc/18a0824b5b1bffb9153e to your computer and use it in GitHub Desktop.
Parse URL into object
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 search = location.search.substring(1); | |
JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment