hdw
2018-10-19 f5def6a97e1a5de359121dfd7b6057ba29fe934c
gx_tieta/WebRoot/js/base.js
@@ -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;
}