0
我的ajax请求中出现错误200。我想发布1个值,这是一个电子邮件地址到我的ajax请求中的页面。有人能告诉我什么是错PHP ajax请求返回字符串
错误:从服务器
message=:[object Object], text status=:parsererror, error thrown:=SyntaxError: JSON.parse: unexpected end of data
JQuery的
$('#checkemail').click(function() {
$.ajax({
url:'http://' + location.host + '/buyme/include/getemailaddress.php',
type:'POST',
contentType: "application/json; charset=utf-8",
data: {email:$('#email').val()},
dataType:"json",
success: function(msg) {
alert(msg);
},
error: function(ms, textStatus, errorThrown) {
alert(errorThrown);
}
});/**/
});
错误200? 200是成功的代码。从错误信息我怀疑你没有返回有效的JSON –
什么说'getemailaddress.php'? –
告诉我们你的'getemailaddress.php' – coolguy