Last active
January 3, 2016 01:09
-
-
Save jgraup/8387155 to your computer and use it in GitHub Desktop.
JS-Common.js
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
<!-- JSON --> | |
<script id="myJson" type="application/json">{"name":"foo"}</script> | |
<!-- Load JSON --> | |
<script type="text/javascript"> | |
(function(){ | |
var obj = jQuery.parseJSON($('#myJson').html()); | |
console.log(obj.name); //Foo | |
var json = JSON.stringify(obj); | |
console.log(json); // {"name":"foo"} | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment