Answer the question
In order to leave comments, you need to log in
Why is there an error when reading JSON?
Error downloading JSON , why ?
<!DOCTYPE html>
<html>
<body>
<h2>Create Object from JSON String</h2>
<p id="demo"></p>
<script>
var obj = JSON.parse('{ "name":"John", "age":30, "city":"New York"}');
document.getElementById("demo").innerHTML = obj.name + ", " + obj.age " , " + obj.city ;
</script>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
MaxKorz has already pointed out where the error is.
For the future, open the console (f12), there will be an error message, if you click on it, they will even show exactly where.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question