hdw
2018-10-19 f5def6a97e1a5de359121dfd7b6057ba29fe934c
gx_tieta/WebRoot/js/base.js
@@ -506,8 +506,9 @@
function getQueryString(name) { 
   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
   var r = window.location.search.substr(1).match(reg); 
   if (r != null)
      return unescape(r[2]);
   if (r != null) {
      return decodeURI(r[2]);
   }
   return null; 
}
@@ -1176,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;
}