Put your name in the form below and click to witness the magic of Ajax.
Client Side Code:
$(document).ready(function(){
$('#btn1').click(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "test2.php",
cache: false,
data: "inputName="+$("#inputName").val(),
dataType: "text",
success: function(text){
eval(text);
$("#main p:first").append("This is what came back from the server: "+text);
}
});
});
});
Server Side Code: