Skip to content

Instantly share code, notes, and snippets.

@code-for-coffee
Last active August 29, 2015 14:25
Show Gist options
  • Save code-for-coffee/f349764a79e1c8f25be7 to your computer and use it in GitHub Desktop.
Save code-for-coffee/f349764a79e1c8f25be7 to your computer and use it in GitHub Desktop.
ajax-prep
var app = app || {};
app.getRequest = {
type: 'get',
url: 'http://ga-chicago.github.io/project1/data.json',
dataType: 'json',
success: function(data) {
console.log(data);
},
error: function(error) {
console.log(error);
}
};
$.ajax(getRequest);
var app = app || {};
app.postRequest = {
type: 'get',
url: 'http://ga-chicago.github.io/project1/data.json',
dataType: 'json',
success: function(data) {
console.log(data);
},
error: function(error) {
console.log(error);
}
};
$.ajax(postRequest);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment