Possible Duplicate:
jQuery won't parse my JSON from AJAX query
So I have parsed and JSON stringified a 'free to use' KML file (which is basically just XML for Google maps) so that I can loop through every countries borders. Now my issue is when I do attempt to go through the JSON array it gives me "syntax error".
My current code is:
$.ajax({
type: "GET",
url: "./doc.json",
dataType: "json",
success: function (json) {
var len = json.length;
for (i = 0; i <= len; i++) {
//Do stuff
}
}
});
For some reason this is giving me this error:
syntax error @ file:///C:/Users/Toms/Documents/WorldWar/doc.json:1
I have the file on pastebin (warning its rather large) http://pastebin.com/0CN9EWja and I have attempted to use 'JSON Lint' to verify it however the file is too large and crashes my browser before being able to verify it. I can see there is a few null arrays thrown in there randomly but I wouldn't have thought that this would stop it being valid JSON.