62,046
社区成员
发帖
与我相关
我的任务
分享
function ajaxRequest() {
$.ajax({
type: "GET",
contentType: "application/json",
url: "GetMarker.ashx?callback=?&IMEI=" + escape(IMEI),
dataType: "jsonp",
data: "{}",
jsonpCallback: "getDataCallBack",
success: function (data) {
}
});
}
var time = 10;
function number() {
if (time >= 0) {
$("#li_Ds").html(time + "秒后刷新");
time--;
if (time == 0) {
ajaxRequest();
time = 10;
}
window.setTimeout("number()", 1000);
}
}
window.onload = function () {
ajaxRequest();
number();
}
function getDataCallBack(str) {
//alert(str);
var tm = str.split('|');
//alert(tm[11]);
// zx, zy, x, y, name, time, speed, direction, GPSstatus, carstatus, warning, wstatus, address;
$("#li_address").html("目前位置:" + tm[11]);
$("#li_Status").html("状态:" + tm[7] + " " + tm[8]);
$("#li_Warm").html("报警信息:" + tm[9]);
//调用下面的方法
/*setLocation(tm[0], tm[1], tm[2], tm[3], IMEI, tm[4], tm[5], tm[6], tm[7], tm[8], tm[9], tm[10], tm[11]);*/
}