Created
January 17, 2015 05:57
-
-
Save wmakeev/e7f942318250c80b5f28 to your computer and use it in GitHub Desktop.
Safe Json as Javascript (http://timelessrepo.com/json-isnt-a-javascript-subset)
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 javaScriptStr = JSON.stringify(obj) | |
.replace('\u2028', '\\u2028') | |
.replace('\u2029', '\\u2029'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment