This URL outputs JSON in the browser
But when I use it with Jquery like below, it seems to output this error
{"STATUS":"ERROR","MESSAGE":"Error while retrieving availability. Search parameters are not valid. callback is not a valid request parameter. _ is not a valid request parameter.","RESPONSE_SENT_TS":"2014-08-15T12:16:01.455-07:00","REQUEST_RECD_TS":"2014-08-15T12:16:01.450-07:00"}
And this is the code I'm using
var parkingUrl = "http://api.sfpark.org/sfpark/rest/availabilityservice?lat=37.7832776731&long=-122.405537559&radius=0.10&uom=mile&response=json";
$.ajax({
url:parkingUrl,
type:'GET',
dataType:'JSONP',
success: function(data){
console.log(data);
}
});
According to their API docs, they do in fact support JSONP, you need to add this parameter:
&jsoncallback=callbackFunctionName
To your request url