我无法获取任何回调数据:
<script type="text/javascript">
jQuery(function(){
jQuery("#JqPostForm").submit(function(){
jQuery.post("index.php?option=comp&task=sendemail", jQuery("#JqPostForm").serialize(),
function(data){
alert('ok');
if(data.email_check == 'invalid'){
jQuery("#message_post").html("<div class='errorMessage'>Sorry " + data.name + ", " + data.email + " is NOT a valid e-mail address. Try again.</div>");
} else {
jQuery("#message_post").html("<div class='successMessage'>" + data.email + " is a valid e-mail address. Thank you, " + data.name + ".</div>");
}
}, "json");
return false;
});
});
</script>
echo json_encode($return_arr);
即:
{"email_check":"invalid","name":null,"email":null}
但我在本地主机和firefox上开发的