ajax轉爲同步

Ajax請求默認的都是異步的 若是想同步 async設置爲false就能夠(默認是true)php var html = $.ajax({ url: 「some.php」, async:false,//更改成同步 }).responseText;html 或者在全局設置Ajax屬性 $.ajaxSetup({ async: false }); 再用post,get就是同步的了web
相關文章
相關標籤/搜索