After reviewing the post, I am still unclear about what is going on.
Although my variable "text" seems to be valid based on most JSON online data checkers, when I attempt to parse it, nothing happens.
Here's a snippet of example code:
<!DOCTYPE html>
<html>
<body>
<h2>Creating an Object from a JSON String</h2>
<p id="demo"></p>
<script>
var text = '{
"zipcodes": [
{
"zip": "22312",
"city": "Alexandria",
"state": "VA"
},
{
"zip": "22030",
"city": "Fairfax",
"state": "VA"
},
{
"zip": "22301",
"city": "Tyson's Corner",
"state": "VA"
},
{
"zip": "20148",
"city": "Ashburn",
"state": "VA"
}
]}';
obj = JSON.parse(text);
document.getElementById("demo").innerHTML =
obj.zipcodes[1].zip + " " + obj.zipcodes[1].city;
</script>
</body>
</html>