AJAX is a technique for send and receive data from server without reloading the page.
AJAX stands for Asynchronous JavaScript And XML.
You can update a part of webpage using AJAX.
It is not a programming language.
The main purpose of using AJAX is to avoid page reload and do multiple work on a same page.
Example: Insert, Update, Delete , fetch in one page.
In 2005 by Google, used AJAX for show suggestions to user.
<script>
$(document).ready(function() {
$('#butsave').on('click', function() {
$("#butsave").attr("disabled", "disabled");
var name = $('#name').val();
var email = $('#email').val();
$.ajax({
url: "save.php",
type: "POST",
data: {
name: name,
email: email
},
cache: false,
success: function(dataResult){
var dataResult = JSON.parse(dataResult);
if(dataResult.statusCode==200){
$('#success').html('Data added successfully !');
}
else if(dataResult.statusCode==201){
alert("Error occured !");
}
}
});
});
});
</script>