Skip to content

Instantly share code, notes, and snippets.

@jsven69gist
Created January 11, 2014 12:07
Show Gist options
  • Save jsven69gist/8370166 to your computer and use it in GitHub Desktop.
Save jsven69gist/8370166 to your computer and use it in GitHub Desktop.
jQuery: Ajax request
// Ajax data
var data = new Object();
data.property1 = 'Prop1';
data.property2 = 'Prop2';
// Ajax options
var options = new Object();
options.data = data;
options.dataType = 'text';
options.type = 'post';
options.url = 'file_ajax.php';
options.success = function(response) {
if (response == 'whatever') {
} else {
}
}
// Ajax request
$.ajax(options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment