window.urls ={ ciaurl :envconfig.ciadomain+"/internal_api/authorizebyjsonp?client_id=", registerurl:envconfig.registerdomain, storeurl:envconfig.storedomain, passporturl:envconfig.passportdomain }; window.g = new (function(){ /* describe:追加js文件+时间戳 param:js文件路径 */ this.addscript=function (url) { var doc = document; var script = doc.createelement("script"); script.setattribute("type", "text/javascript"); script.src = url+"?t="+new date().gettime(); doc.documentelement.appendchild(script); }, /* describe:追加css文件+时间戳 param:css文件路径 */ this.addcss=function (url){ var doc=document; var link=doc.createelement("link"); link.setattribute("rel", "stylesheet"); link.setattribute("type", "text/css"); link.setattribute("href", url+"?t="+new date().gettime()); var heads = doc.getelementsbytagname("head"); if(heads.length) heads[0].appendchild(link); else doc.documentelement.appendchild(link); }, /* describe:截取url参数 param:参数key */ this.urlparam=function(key){ var search = location.search; search = search.replace("?",""); var items = search.split("&"); var item,i; for(i=0;i 0) { flag = false; break; } } return flag; })(), /* describe:判断是否是微信 */ this.iswx=(function(){ var ua = navigator.useragent.tolowercase(); if (ua.match(/micromessenger/i) == "micromessenger") { return true; } else { return false; } })(), /* describe:判断是否是微信 param:event=>规定指定元素要触发的事件 data=>参数 */ this.trigger=function(event,data) { $(document).trigger(event,data); } })();