这里是我的代码:
var jqxhr = $.post("mypage.php", {url:pageurl}, function() {
alert("fetching...");
})
.success(function() { alert("fetch complete!"); })
.error(function() { alert("error!"); })
.complete(function() { alert("complete"); });
// Set another completion function for the request above
jqxhr.complete(function(){ alert("second complete"); });
我得到的警报(‘正在获取...’)对话框,但对其余代码没有完成。我得到错误:$ .post(“sec_fetch_report.php”,function(){alert(“fetching ...”);})。成功不是函数
我想也许我可能会失踪jquery库,但我有另一个函数调用$ .post,它运行得很好。有什么语法错误我在某处丢失或什么? 谢谢
他的语法在版本1.6中有效。 – ehynds 2011-05-12 18:08:58
是的,它的有效。 $ .post()相当于$ .ajax({type:'POST'.... – 2011-05-12 18:10:26
抱歉,必须downvote,这种语法是完全有效的.jqxhr对象是可链接的,从v1.5我相信 – 2011-05-12 18:10:40