<!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);放在這個請求前試試