Created
July 4, 2018 06:49
-
-
Save aloha1003/9d144d6de4530ab417499c14cc5f76af to your computer and use it in GitHub Desktop.
js parse location query
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
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