0
我得到一个Desc :: parsererror |错误:: SyntaxError:以下代码的意外的令牌U错误。 PHP页面是呼应json_encode
产生JSON,还含有JSON解析错误。意外的令牌U
header("Content-type: application/json");
这里是AJAX代码。
$.ajax({
url: 'questions/checkAnswer',
type: 'POST',
data: {questionId : questionIdValue, answer : answerValue},
dataType: 'json',
success:function(result){
console.log(result);
},
error:function(xhr, desc, err) {
console.log(xhr);
console.log("Desc :: "+desc+"\nError :: "+err);
}
});
任何人都可以帮我关于我哪里错了?
向我们展示浏览器接收到的JSON响应。 –
我不知道我能否帮到你。如果你要求的是JSobject,那么这里是{“question_id”:“0”,“question_name”:“谁赢了最后一个板球杯?”,“choice_a”:“印度”,“choice_b”:“澳大利亚” ,“choice_c”:“南非”,“choice_d”:“新西兰”} – psyc0der
......什么是“JSObject”?你的意思是[“JSON文本?”](https://tools.ietf.org/html/rfc4627#section-2) –