Skip to content

Instantly share code, notes, and snippets.

@mapsam
Created May 28, 2014 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mapsam/2de9e630beaf3c97d265 to your computer and use it in GitHub Desktop.
Save mapsam/2de9e630beaf3c97d265 to your computer and use it in GitHub Desktop.
jQuery ajax with jsonp to census.gov
$.ajax({
type: "GET",
dataType: "jsonp",
contentType: "application/json",
url: 'http://geocoding.geo.census.gov/geocoder/locations/onelineaddress?address=131+Riverlawn+Ave%2C+Watertown%2C+53094&benchmark=9&format=jsonp',
success: function(data) {
console.log(data)
},
error: function(xhr, ajaxOptions, thrownError) {
console.log(xhr.status, thrownError);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment