$.getJSON are returning a file with IE and Opera browsers (Firefox, Chrome... works fine).
The code is this:
$.getJSON("http://open.mapquestapi.com/nominatim/v1/search.php?format=json&osm_type=N&bounded=1&limit=100&viewbox=-5.667593479156494,43.54767717445222,-5.656242370605469,43.54280902999833&q=Restaurants",
{
tagmode: "any",
format: "json"
},
function(data) {
var ind = 0;
$.each(data, function(i, pos_reg){
alert("Recovery " + i++ + " row");
});
})
.error(function() {
alert("Was an error");
});
I think the problem is the Http header returned from the server. If I paste the URL on Firefox or Chrome, I see the JSON respond. If I paste the URL on IE and Opera, they tries download the JSON respond as file.
I tried someting like this:
$.ajaxSetup({ scriptCharset: "utf-8" , contentType: "application/json; charset=utf-8"});
But same result :(
Any idea please? Thanks in advance!