function MyLoading(falg) { var loading = "<div id='dlading' style='position:absolute;left:0;width:100%;height:100%;top:0;background:#FFFFFF;opacity:0.8;filter:alpha(opacity=90);'>"; loading += "<div style='border:2px solid #B7CDFC;position:absolute;cursor:wait;left:50%;top:50%;width:200px;height:32px;line-height:28px;text-indent:36px;font-size:14px;background:#fff url(Content/css/images/loading.gif) no-repeat left center;'>"; loading += "正在加载,请等待......</div></div>"; if (falg) { $("body", document).append(loading); } else { if ($("#dlading") != undefined) { $("#dlading").remove(); } } } $(document).ready(function () { MyLoading(true); if (document.readyState == "complete") { MyLoading(false); } if (document.readyState == "complete") { MyLoading(false); } else { document.onreadystatechange = function () { if (document.readyState == "complete") { MyLoading(false); } } } })
用 document.readyState == "complete" 判断页面是否加载完成。
原创皮尔兄弟 ©著作权
文章标签 document.readyState 文章分类 后端开发
-
readyState总结
关于readyState的状态: 0 未初始化1 载入2 载入完成3 交互 4 完成
ajax readyState 初始化 -
Complete Tripartite
"D Complete Tripartite" 思路:这个题是个染色问题。理解题意就差不多写
思维 染色 ios 离散化 #define -
Complete the Projects
"F1. Complete the Projects (easy version)" "F2. Complete the Projects (h
贪心 DP #define ios #include -
XMLHttpRequest().readyState的五种状态详解
在《Pragmatic Ajax A Web 2.0 Primer 》中偶然看到对readyStae状态的介绍,感觉这个介绍很实在,摘译
Ajax 应用服务器 JavaScript 浏览器 制造 -
用 document.readyState ==
传回XML 文件资料的目前状况。 基本语法 intState = xmlDocument.readyS
document readyState 加载 xml 对象模型