<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="css/fonts/font-awesome.min.css">
<link rel="stylesheet" href="css/ui-box.css">
<link rel="stylesheet" href="css/ui-base.css">
<link rel="stylesheet" href="css/ui-color.css">
<link rel="stylesheet" href="css/appcan.icon.css">
<link rel="stylesheet" href="css/appcan.control.css">
<link rel="stylesheet" href="2_2_content/css/main.css">
<script src="js/jquery-1.11.1.min.js"></script>
<script>
window.uexOnload = function(type){
uexWindow.setBounce(1);
uexWindow.notifyBounceEvent(0,1);
var json='{"textColor":"#000","imagePath":"res://refesh_icon.png","levelText":"更多","pullToReloadText":"拖动到底部","releaseToReloadText":"释放回原处","loadingText":"载入中..."}';
uexWindow.setBounceParams(0, json);
uexWindow.showBounceView("0","#00F", 1);
var json2 ='{"textColor":"#fff","imagePath":"res://refesh_icon.png","levelText":"更多","pullToReloadText":"上拉到底部","releaseToReloadText":"松手回原处","loadingText":"载入中..."}';
uexWindow.setBounceParams(1, json2);
uexWindow.showBounceView("1","rgba(15, 155, 155, 100)", 1);
uexWindow.onBounceStateChange = onBounceStateChange;
}
function onBounceStateChange(type, state){
switch(type) {
case 0:
if (state == 2) {
uexWindow.resetBounceView("0");
uexWindow.open('2_1', '0', '2_1.html', 4, '', '', 4,100);
}
break;
case 1:
if (state == 2) {
uexWindow.resetBounceView("1");
}
}
}
</script>
<script>
var arrData; //从服务器获得的数据
//arrData.pop();//删除数据
//arrData.push({"picture" : OO+".jpg","ABC" : "abcd12",});//添加数据
var arr; //从 arrData解析出来的数据
var arr_LOST; //最终数据
var num; //判断有几组12个数据
var length;
var m_length;
TheArray = new Array(); //先声明一维
m = 0;//表明当前应该执行第几组,默认从最开始的第0组开始
//创建xmlHttp对象,验证网络状况
</script>
<script>
function getHtml(){
$.get("http:// 192.168.0.21:19842/rt/YearServlet",function(data,status){
arrData=data;
arr = eval('('+arrData+')'); //LX:只需要对arr进行修改,可以alert出来看看这个数组
alert("CCC"+arr);
arr_LOST=arr;
});
}
getHtml();
</script>
</head>
<body class="um-vp bc-bg" ontouchstart>
<div class="ub ub-ver">
<div class="umar-a1">
<div class="sc-bg-active uinput ub ub-f1 bc-border uba">
<div class="uinn fa fa-search sc-text"></div>
<input placeholder="搜索你想知道的" type="text" class="ub-f1">
<button class="btn bc-text-head Mybutton" style="color:black; font-weight:bold;" onclick="A()">搜索</button>
</div>
</div>
</div>
<div style="width: 100%" id="page"></div>
<div class=" ub-ver uinn-p1" id="pictureList"></div>
<script src="js/appcan.js"></script>
<script src="js/appcan.control.js"></script>
</body>
<script>
alert('ABC'+arr);
</script>
<script>
appcan.ready(function() {
appcan.initBounce();
})
</script>
</html>
这段代码为何没有先执行getHtml();并弹出alert("CCC"+arr);
而是先执行alert('ABC'+arr);
再执行的alert("CCC"+arr);
如何先执行alert('ABC'+arr);呢?
时间估计话费在这个请求上了` $.get("http:// 192.168.0.21:19842/rt/YearServlet",function(data,status){
你把 alert("CCC"+arr);`放在这个请求前试试
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。