hdw
2018-10-25 bb65f33c9fdff40844f17e95e3e75aed2b42bda2
gx_tieta/WebRoot/js/base.js
@@ -387,7 +387,7 @@
            document.getElementById("StationId").innerHTML=data.StationId;               //机房id
            document.getElementById("StationName").innerHTML=data.StationName;            //机房名称
            document.getElementById("StationIP").innerHTML=data.StationIp;               //机房ip
            //document.getElementById("batt_group_id").innerHTML=data.BattGroupId;         //电池组ip
            document.getElementById("batt_group_id").innerHTML=data.BattGroupId;         //电池组ip
            
            document.getElementById("BattGroupName").innerHTML=data.BattGroupName;         //电池组名称
            document.getElementById("BattGroupNum").innerHTML=data.BattGroupNum;         //电池组序号
@@ -1126,7 +1126,7 @@
                    if(linkNum == 3) {
                       console.info('出现第'+linkNum+"次测试服务器连接失败!跳转到登陆");
                       // 网络正常但服务器连续多次检测不正常跳转到登陆页面
                      alert('服务器运行异常,请查看服务器是否正在运行!');
                      alert('网络连接异常,请检查网络连接是否正常!');
                       window.location.replace("login.jsp");
                    }else {
                       console.info('出现第'+linkNum+"次测试服务器连接失败!");
@@ -1177,4 +1177,29 @@
// 判断是否为对象
function isObject(s) {
   return (typeof s === 'object' && !isArray(s));
}
//使用XMLHttpRequest的方式获取模板页
function getTpl(url) {
   var xmlhttp;   // 实例化XMLHttpRequest对象
   if(window.XMLHttpRequest) {
      xmlhttp = new XMLHttpRequest();
   }else {
      xmlhttp = new ActiveXObject('Mocrosoft.XMLHTTP');
   }
   // 设置请求
   xmlhttp.open('GET', url, false);
   // 发送请求
   xmlhttp.send();
   var tpl;
   if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
      tpl = xmlhttp.responseText;
   }else {
      tpl = "";
   }
   return tpl;
}