Last active
October 8, 2015 12:58
-
-
Save puiutucutu/711f253f8e190f3d2779 to your computer and use it in GitHub Desktop.
jQuery Ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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