what is data in jquery ajax code example
Example 1: ajax exmaple\
$.ajax({
url:'your url',
type: 'POST',
data: { myData: 'This is my data.' },
success: function (data, status, xhr) {
$('p').append('status: ' + status + ', data: ' + data);
},
error: function (jqXhr, textStatus, errorMessage) {
$('p').append('Error' + errorMessage);
}
});
Example 2: $.ajax javascript
$.ajax({
url: 'https://example.com/your-page',
success:function(data){
},
error:function(){
alert('An error was encountered.');
}
});