1. jQuery Post Method Without json Response
var post_data = 'operation=add&name=Rahul&email=rahul@gmail.com';
jQuery.post('/admin/ajax/do.php', post_data, function(response){
if(response.msg=="success"){
alert("Insert Successfully");
}else{
alert("Error Occured");
}
});
2. jQuery Post Method With json Response
var post_data = 'operation=add&name=Rahul&email=rahul@gmail.com';
jQuery.post('/admin/ajax/do.php', post_data, function(response){
if(response.msg=="success"){
alert("Insert Successfully");
}else{
alert("Error Occured");
}
},'json');
0 comments: