- /**
- * www.faceye.com 网络支持系统
- * 作者:宋海鹏 ecsun@sohu.com/myecsun@hotmail.com/QQ:82676683
- * 说明:javascripts 工具类
- *
- */
- /**
- * 动态加载JS文件
- */
- var Faceye = {
- version : 1.0,
- /**
- *简单取得httpRequest
- */
- httpRequest : function() {
- var xRequest = null;
- if (window.XMLHttpRequest) {
- xRequest = new XMLHttpRequest();
- } else if (window.ActiveXObject) {
- xRequest = new ActiveXObject("MsXml2.XmlHttp");
- }
- return xRequest;
- },
- /**
- *简单的加载文件
- */
- load : function(src) {
- var headerDom = document.getElementsByTagName('head').item(0);
- var jsDom = document.createElement('script');
- jsDom.type = 'text/javascript';
- jsDom.scr = src;
- headerDom.appendChild(jsDom);
- },
- /**
- *通过ajax方式加载js
- */
- ajaxLoad : function(src) {
- var xRequest = this.httpRequest();
- xRequest.open('GET',src,true);
- xRequest.send(null);
- var headerDom = document.getElementsByTagName('head')
- .item(0);
- var jsDom = document.createElement('script');
- jsDom.type = 'text/javascript';
- jsDom.language='javascript';
- jsDom.defer=true;
- jsDom.text=xRequest.responseText;
- headerDom.appendChild(jsDom);
- }
- };