日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ajax 同步怎么回调,Ajax jquery同步回调成功

發布時間:2024/9/27 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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同步回调成功的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。