Last active
October 9, 2017 13:15
-
-
Save rafaelmaeuer/16badcf165dbe0934556a63f21286d2b to your computer and use it in GitHub Desktop.
Convert JSON to/from URI-encoded String - From https://stackoverflow.com/questions/9909620/convert-json-into-uri-encoded-string
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
function jsonToURI(json){ return encodeURIComponent(JSON.stringify(json)); } | |
function uriToJSON(urijson){ return JSON.parse(decodeURIComponent(urijson)); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment