app 网络加载提示问题

来源:互联网 发布:福彩3d2016年开奖数据 编辑:程序博客网 时间:2024/06/10 22:58

loading.html
<!DOCTYPE html><html><head><meta charset="utf-8">    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">    <title>title</title>    <link rel="stylesheet" type="text/css" href="../css/api.css"/>    <style>    html {width: 100%;height: 100%;background: transparent !important;}body {background: transparent !important;width: 100%;}    </style></head><body></body><script type="text/javascript" src="../script/api.js"></script><script type="text/javascript">apiready = function(){};</script></html>

api.openFrame({
name : 'loading',
url : 'loading.html',
rect : {
x : 0,
y : 0,
w : api.winWidth,
h : api.winHeight
}
});




进行网络请求时,提示用户正在进行操作,请等待。一般的做法是弹出一个加载框,api.showProgress(),不推荐这样的做法,因为经常会出现loading框卡死问题。建议做法是Header提示正在加载,整个页面弹出透明遮掩层,不准用户进行操作。