$.ajax({ type: "POST", url: "/index.php", data: data, dataType: "json", success: function(r_msg){ if(r_msg.status==0){ alert("fail"); }else{alert("ok"); } } });