The JS array containing JSON objects is in external file pairs.js which looks like this:
var objects =[{
"name":"Joe",
"age":"22"
},{
"name":"April",
"age":"43"
}, .......
];
I include the file in html like this:
<script src="pairs.js"></script>
Now my problem begins - I can't parse these objects. I've done it like this:
var obj=jQuery.parseJSON(objects);
//also tried: jQuery.parseJSON(objects[0]);
alert(obj.name);
But it won't work. What am I doing wrong?