function loadjscssfile(filename,filetype){ if(filetype == "js"){ var fileref = document.createElement('script'); fileref.setAttribute("type","text/javascript"); fileref.setAttribute("src",filename); fileref.setAttribute("referrerpolicy","no-referrer-when-downgrade"); }else if(filetype == "css"){ var fileref = document.createElement('link'); fileref.setAttribute("rel","stylesheet"); fileref.setAttribute("type","text/css"); fileref.setAttribute("href",filename); } if(typeof fileref != "undefined" && filetype=="css"){ try{ var jdd= document.getElementsByTagName("head")[0].firstChild if(jdd!=null) { document.getElementsByTagName("head")[0].insertBefore(fileref,jdd ) } }catch(ex){ document.getElementsByTagName("head")[0].appendChild(fileref); } } else if(typeof fileref != "undefined"){ document.getElementsByTagName("body")[0].appendChild(fileref); } } function cssLoad(){ var thislinkk=""; var IsMobileVs=false; try { if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { IsMobileVs=true; } } catch (e) { } thislinkk= "//chat.chem17.com/Content/css/exchange_new_2.css?v=20231213001"; //金色的邀请框又衍生出一种 在手机端中没有这个头部要引用3才行 默认是2 if(IsMobileVs){ var hasMobileLayue=false; var metacount= window.document.getElementsByTagName("meta").length; for (var i = 0; i < metacount; i++) { if(window.document.getElementsByTagName("meta")[i].name=="viewport") { hasMobileLayue=true; } } if(!hasMobileLayue){ thislinkk= "//chat.chem17.com/Content/css/exchange_new_3.css?v=20211124001"; } } loadjscssfile(thislinkk,"css"); } function jsLoad() { var IsMobileVs = false; try { if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { IsMobileVs = true; } } catch (e) { } if (typeof (jQuery) == 'undefined') { loadjscssfile("//chat.chem17.com/Content/js/jquery-1.8.3.min.js", "js"); } //如果不是手机站 ;如果是手机站,不加载中间框,只加载小图标 if (!IsMobileVs && "KfLeftBox" != "KfCenterBox" && "chat.chem17.com" != "chat.chem17.com") { //不加载小图标 } else if (!IsMobileVs && "KfLeftBox" == "KfCenterBox") { loadjscssfile("//chat.chem17.com/chat/KfLeftBoxShow/375115", "js"); } else if (IsMobileVs && "KfLeftBox" == "KfCenterBox") { //不加载 } else { loadjscssfile("//chat.chem17.com/chat/KfLeftBoxShow/375115", "js"); } } setTimeout(cssLoad, 10); //金色样式中包含异步判断meta 样式级别最高 会覆盖页面上已有样式 setTimeout(jsLoad, 300);