var dynamicLoading = {//动态加载CSS模块 css: function(path){ if(!path || path.length === 0){ throw new Error('argument "path" is required !'); } var head = document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.href = path; link.rel = 'stylesheet'; link.type = 'text/css'; head.appendChild(link); }, js: function(path){ if(!path || path.length === 0){ throw new Error('argument "path" is required !'); } var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.src = path; script.type = 'text/javascript'; head.appendChild(script); } } try {//识别终端模块 var urlhash = window.location.hash; var isphone=0; var str=""; var showonwhere=0; if (!urlhash.match("fromapp")) { if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i))) { //window.location="http://www.huangyinqi.com/index_m.php"; isphone=1; } } } catch(err) { } if(isphone==1) //判断是否手机 {dynamicLoading.css("/ziti/images/mtop.css"); //如果是手机动态加载手机版CSS } else{ dynamicLoading.css("/ziti/images/top.css");//动态加载PC CSS } function showcustom(str,showonwhere) //根据客户端 决定要显示什么内容str为显示的内容,showonwhere取1为手机端 取0为PC端 默认为PC端 { if(isphone==showonwhere) { document.write(str); } }