【发布时间】:2014-02-25 16:40:35
【问题描述】:
我有:
<script>
$('#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{
}
}
})
});
</script>
这似乎适用于所有浏览器除了 IE,这是为什么呢?
我做对了吗?我唯一需要的是访问返回的数据,例如 response.status 和 response.reason 。
感谢您的帮助
【问题讨论】:
-
此处出现错误
email = $(tihs).val();。email也泄漏到全局范围。 -
在 IE 中发生了什么以及使用的 jQuery 版本是什么
-
你用的是什么版本的IE。
-
@TAS IE 10,我测试了一些警报,似乎没有发送作业值,我收到“未发送作业”
-
@elclanrs 在这里打错了,在我的源码里没问题,顺便编辑了
标签: javascript jquery ajax json jquery-callback