Skip to content

Instantly share code, notes, and snippets.

@richardbenson
Created December 8, 2011 16:11
Show Gist options
  • Save richardbenson/1447457 to your computer and use it in GitHub Desktop.
Save richardbenson/1447457 to your computer and use it in GitHub Desktop.
Specify as many or as few options as you go
$.ajaxSetup({
url: '/api/',
type: 'POST',
dataType: 'json'
});
//------ e.g. 1, just need to specify data
$.ajax({
data: 'serverid=' + YAMS.admin.selectedServer + '&action=save-server-settings&' + $('#settings-form').serialize()
});
//------ Or do a full request, but the next one will go back to defaults
$.ajax({
url: '/assets/parts/apps-page.html',
type: 'GET',
dataType: 'text',
success: function (data) {
$('#apps-tab').html(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment