将$ .ajax()中的回调响应视为JSON

我有:

 $('#email').on('blur', function(){ email = $(tihs).val(); $.ajax({ type: "POST", url: "ajax.php", data: { 'email': email, 'job': 'check', }, dataType: "JSON", success: function (response) { // the response from PHP is smth like: // {"status":"failed","reason":"email_not_validated"} // now I want to: if(response.status == 'success'){ }else{ } } }) });  

这似乎适用于IE以外的每个浏览 ,为什么会这样?

我做对了吗? 我唯一需要的是访问返回的数据,如response.statusresponse.reason

谢谢你的帮助

这是一个提到IE10的bug ,可以通过添加来修复

  

。 注意在不应该有另一个带有X-UA-Compatible元标记,因为前一个标记将被覆盖。