Jquery ajax加載等待執(zhí)行結(jié)束再繼續(xù)執(zhí)行下面代碼操作
更新時間:2015年11月24日 14:25:56 作者:空山瘋雨
這篇文章主要介紹了Jquery ajax加載等待執(zhí)行結(jié)束再繼續(xù)執(zhí)行下面代碼操作的相關(guān)資料,需要的朋友可以參考下
Jquery等待ajax執(zhí)行完畢再繼續(xù)執(zhí)行下面代碼的效果,具體代碼如下,其實(shí)就是將 jquery ajax 函數(shù)的 async 參數(shù)設(shè)置為 false 即可,該參數(shù)默認(rèn)為 true:
$(document).ready(function(){
loadphpernote();
window.open('http://www.phpernote.com');
});
function loadphpernote(){
var url='http://www.phpernote.com/ajax.php';
var data='action=list';
jQuery.ajax({
type:'post',
url:url,
data:para,
async:false,//false代表只有在等待ajax執(zhí)行完畢后才執(zhí)行window.open('http://www.phpernote.com')語句
success:function (msg){
$('#articleList').html(msg);
}
});
}
下面給大家介紹jquery 加載等待效果
var dates = this.options.form.getWidgetByName("dates").getValue();
$.ajax({
url: "http://127.0.0.1:9009/Brilliantzz/service/snproduct.do",
data:dates,
beforeSend:function() {
var h = document.body.clientHeight;
$("<div class=\"datagrid-mask\"></div>").css({display:"block",width:"100%",height:h}).appendTo("body");
$("<div class=\"datagrid-mask-msg\"></div>").html("正在上傳生產(chǎn)數(shù)據(jù),請稍候。。。").appendTo("body").css({display:"block",
left:($(document.body).outerWidth(true) - 190) / 2,
top:(h - 45) / 2});
},
complete:function(data) {
$('.datagrid-mask-msg').remove();
$('.datagrid-mask').remove();
},
success: function(data) {
alert("生產(chǎn)數(shù)據(jù):"+data);
},
error: function(data) {
alert("上傳生產(chǎn)數(shù)據(jù)異常!");
}
});
您可能感興趣的文章:
- jQuery+Ajax+js實(shí)現(xiàn)請求json格式數(shù)據(jù)并渲染到html頁面操作示例
- 為jquery的ajax請求添加超時timeout時間的操作方法
- JQuery中Ajax的操作完整例子
- jQuery+Ajax實(shí)現(xiàn)無刷新操作
- jquery插件ajaxupload實(shí)現(xiàn)文件上傳操作
- Jquery操作Ajax方法小結(jié)
- Jquery Ajax請求文件下載操作失敗的原因分析及解決辦法
- jQuery學(xué)習(xí)筆記之 Ajax操作篇(二) - 數(shù)據(jù)傳遞
- 通過實(shí)例解析jQ Ajax操作相關(guān)原理
相關(guān)文章
jquery獲取焦點(diǎn)和失去焦點(diǎn)事件代碼
鼠標(biāo)在搜索框中點(diǎn)擊的時候里面的文字就消失了,經(jīng)常會用到搜索框的獲得焦點(diǎn)和失去焦點(diǎn)的事件,接下來介紹一下具體代碼,感興趣的朋友額可以參考下2013-04-04
jQuery插件HighCharts繪制簡單2D柱狀圖效果示例【附demo源碼】
這篇文章主要介紹了jQuery插件HighCharts繪制簡單2D柱狀圖效果,結(jié)合完整實(shí)例形式分析了jQuery使用HighCharts插件繪制2D柱狀圖的實(shí)現(xiàn)步驟與相關(guān)操作技巧,并附帶demo源碼供讀者下載參考,需要的朋友可以參考下2017-03-03
jQuery + html + css 實(shí)現(xiàn)王者榮耀官網(wǎng)首頁效果&nb
這篇文章主要介紹了jQuery + html + css 實(shí)現(xiàn)王者榮耀官網(wǎng)首頁效果,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-02-02

