-
-
Save mannuelf/078f475af2a615195a48632a6a363942 to your computer and use it in GitHub Desktop.
ParseJSON demo ParseJSON Function, turns JSON into javasctipt objects // source http://jsbin.com/ragupa
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
<meta name="description" content="ParseJSON Function, turns JSON into javasctipt objects"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>ParseJSON demo</title> | |
</head> | |
<body> | |
<div id="output"></div> | |
<script id="jsbin-javascript"> | |
$(function() { | |
var json = '{"fname": "Johny", "lname": "Five", "age": 33}'; | |
var jsObject = $.parseJSON(json); | |
$('#output').append(jsObject.fname + "<br/>" + jsObject.lname + "<br/>" + jsObject.age); | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">$(function() { | |
var json = '{"fname": "Johny", "lname": "Five", "age": 33}'; | |
var jsObject = $.parseJSON(json); | |
$('#output').append(jsObject.fname + "<br/>" + jsObject.lname + "<br/>" + jsObject.age); | |
});</script></body> | |
</html> |
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() { | |
var json = '{"fname": "Johny", "lname": "Five", "age": 33}'; | |
var jsObject = $.parseJSON(json); | |
$('#output').append(jsObject.fname + "<br/>" + jsObject.lname + "<br/>" + jsObject.age); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment