我正在使用 $.post
调用 ajax 页面。
$.post("ajaxpage.php", $("#theform").serialize());
如何回显页面返回的响应?我尝试保存到 var,但它没有给我响应。
var resp = $.post("ajaxpage.php", $("#theform").serialize());
console.log(resp);
最佳答案
$.post("ajaxpage.php", $("#theform").serialize(), function(data, status, xhr) {
console.log(data);
});
关于jquery - 从 $.post 获取回复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7734999/