Ajax Jquery通过发送对象值来注释/PHP错误
发送var注释\u id:Ajax Jquery通过发送对象值来注释/PHP错误,ajax,Ajax,发送var注释\u id: echo $json = json_encode(array('annotation_id'=>$save[0])); 获取var注释\u id: if (image.useAjax) { $.ajax({ url: image.saveUrl, data: form.serialize(), error: function(e) { alert("An
echo $json = json_encode(array('annotation_id'=>$save[0]));
获取var注释\u id:
if (image.useAjax) {
$.ajax({
url: image.saveUrl,
data: form.serialize(),
error: function(e) {
alert("An error occured saving that note.");
},
success: function(data) {
if (data.annotation_id != undefined) {
editable.note.id = data.annotation_id;
alert(editable.note.id);
}
},
dataType: "json"
});
}
那么…我的代码怎么了?
无法获取此变量的值。您能给我们提供更多信息吗?你运行这个时发生了什么?您是否收到错误?始终收到错误,我可以获得变量的值。当您运行时,会出现警报(“保存该注释时发生错误”);您是否尝试过手动访问ajax调用指向的url,它是否返回了正确的值?另外,看看错误回调中的“e”变量,它可能会为您提供更多信息。