当我在使用jquery Uncaught TypeError: Object #<error> has no method 'apply'
时尝试从回调函数返回true时,我得到.load()
。这让我感到困惑,为什么我不被允许回归真实?
$(function () {
$("#myIdentifier").load("/some/url", {"someuselessdata" : 1, "moreuselessdata" : 1}, myHandlerFun());
});
function myHandlerFun () {
console.log("Running handler function...");
return true;
}
如果我像这样执行GET请求,不
$(function () {
$("#myIdentifier").load("/some/url", myHandlerFun());
});
function myHandlerFun () {
console.log("Running handler function...");
return true;
}
http://jsfiddle.net/4hvczLkf/或者如果我像这样返回
$(function () {
$("#myIdentifier").load("/some/url", {"someuselessdata" : 1, "moreuselessdata" : 1}, myHandlerFun());
});
function myHandlerFun () {
console.log("Running handler function...");
return false;
}