Skip to content

Instantly share code, notes, and snippets.

@stevenbeeckman
Created October 2, 2015 08:27
Show Gist options
  • Save stevenbeeckman/b5fadaffdf9d1350cdfc to your computer and use it in GitHub Desktop.
Save stevenbeeckman/b5fadaffdf9d1350cdfc to your computer and use it in GitHub Desktop.
HTTP GET through AJAX with jQuery in the browser.
// Docs: http://api.jquery.com/category/ajax/
$.ajax({
type: "GET"
, url: "api/locations.php"
, dataType: "json" //this can be json, XML, ...
, success: function(data){
console.dir(data);
, error: function(err){
console.dir(err);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment