Last active
January 5, 2019 11:51
-
-
Save gurkanakdeniz/840d79f23ed960bea64b9e8e35b2108b to your computer and use it in GitHub Desktop.
Simple 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
function sendData(userId, url) { | |
$.ajax({ | |
type : "POST", | |
contentType : "application/json", | |
url : url, | |
data : userId, | |
dataType : 'json', | |
cache : false, | |
beforeSend: function() { | |
// loading vs | |
}, | |
success : function(result) { | |
// success | |
}, | |
error: function(jqXHR, textStatus, errorThrown) { | |
// error | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment