ajax 同步怎么回调,Ajax jquery同步回调成功
我有這個函數,使ajax調用。我在最后一段代碼注釋中描述了這個問題。Ajax jquery同步回調成功
function doop(){
var that = this;
var theold = "theold";
var thenew = "thenew";
$.ajax({
url: 'doop.php',
type: 'POST',
data: 'before=' + theold + '&after=' + thenew,
success: function(resp) {
if(resp == 1) {
$(that).siblings('.theold').html(thenew);
}
}
});
// I have some code here (out of the ajax) that **further** changes
// the .theold's html beyond what it was changed inside ajax success
// but the change depends on whether the resp (inside the success
// function) returned 1 or not, so this code out here depends on the ajax
// so it looks like I have to turn this ajax call into a sync ajax
return false;
}
基于代碼注釋中描述的問題,哪種更改最適合這種情況?
2009-10-15
Chris
總結
以上是生活随笔為你收集整理的ajax 同步怎么回调,Ajax jquery同步回调成功的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: couchdb java 连接_Couc
- 下一篇: 东华大学考研计算机难度,东华大学计算机考