Skip to content

Instantly share code, notes, and snippets.

@stevenbeeckman
Created October 2, 2015 08:27
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