I am trying to consume this JSON
web service: http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.geojson
I have tried the following code:
$.ajax({
url: url,
type: 'GET',
crossDomain: true,
dataType: 'json',
jsonp: false,
success: function() { alert("Success"); },
error: function() { alert('Failed!'); }});
}
I get the following error in chrome :
XMLHttpRequest cannot load ...earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.geojson. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost' is therefore not allowed access.
I have seen all the suggestions for changing datatype
to jsonp
but this doesn't work in my case because this service does not provide jsonp
data.
Is there is any other way to parse this data with JavaScript?