I am trying to get JSON file with JSONP:
function getJson() {
var url = 'http://www.oref.org.il/WarningMessages/alerts.json?callback=?';
$.getJSON(url, function(data) {
checkJson(data);
});
setTimeout(arguments.callee, 2000);
}
getJson();
The problem is that I am getting this error:
Uncaught SyntaxError: Unexpected token :
So I searched online and I found few solutions, but non of them worked.
I tried to use Ajax instead and I tried to replace $.getJSON
with $.parseJSON
but I got this error:
Uncaught SyntaxError: Unexpected token h
The JSON file:
{
"id" : "1406032249536",
"title" : "test",
"data" : []
}