Ajax在请求数据时显示等待动画遮罩
生活随笔
收集整理的這篇文章主要介紹了
Ajax在请求数据时显示等待动画遮罩
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*** 等待提醒 開始 ***********************************************************************************************
-yzy
-20150408
說明:在Ajax請求數據的時候,顯示等待界面*/// 1、這里顯示等待框$('#YWaitDialog').show();// 2、這里進行ajax的請求$.post("/Indent/SelectDevice", { DeviceName: $("#DeviceName1").val(), DepartmentID: $("#DepartmentID").val(), Page: 1, departmentName: $("#departmentName1").val() }, function (data) {if (data != null) {$("#Devices").html(data);}// 3、請求完成隱藏等待框$('#YWaitDialog').hide();});});})
</script>@*等待框的樣式定義*@
<div id="YWaitDialog" style="background-color: #e0e0e0; position: absolute; margin: auto; top: 150px; left: 300px; display: none; height: 60px; width: 300px;"><p style="text-align: center; vertical-align: central;">請等待,正在查詢數據 <img src="~/Content/images/img_y/dialog_icon/YWaitDialogIcon2.gif" /></p>
</div>
@**** 等待提醒 結束 ***********************************************************************************************@
?
總結
以上是生活随笔為你收集整理的Ajax在请求数据时显示等待动画遮罩的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 怎样让VB6程序只能运行一次
- 下一篇: jsp中redirect和forward