Skip to content

Instantly share code, notes, and snippets.

@puiutucutu
Last active October 8, 2015 12:58
Show Gist options
  • Save puiutucutu/711f253f8e190f3d2779 to your computer and use it in GitHub Desktop.
Save puiutucutu/711f253f8e190f3d2779 to your computer and use it in GitHub Desktop.
jQuery Ajax
var requestAJAX = jQuery.ajax({
method: 'POST',
url: 'data-export.php',
dataType: 'html',
data: { nameOfArrayPassedToServer : arrayNameInJS }
});
requestAJAX.done(function(response) {
console.log(response);
for (var i = 0; i < response.length; i++)
jQuery( '#target' ).append(response[i]);
progressSpinner('hide');
});
requestAJAX.fail(function(response){
console.log('ajax failed');
progressSpinner('hide');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment