作家
登录

pjblog中的UBBCode.js

作者: 来源:www.28hudong.com 2013-03-30 03:30:49 阅读 我要评论

//|===========================| //| UBB编辑器JS代码 1.0 | //| 作者:舜子(PuterJam) | //| 版权所有 2005 | //|===========================| var UBBBrowerInfo=new Object(); var sAgent=navigator.userAgent.toLowerCase(); UBBBrowerInfo.IsIE=sAgent.indexOf("msie")!=-1; UBBBrowerInfo.IsGecko=!UBBBrowerInfo.IsIE;UBBBrowerInfo.IsNetscape=sAgent.indexOf("netscape")!=-1; if (UBBBrowerInfo.IsIE){ UBBBrowerInfo.MajorVer=navigator.appVersion.match(/MSIE (.)/)[1]; UBBBrowerInfo.MinorVer=navigator.appVersion.match(/MSIE ..(.)/)[1];} else{ UBBBrowerInfo.MajorVer=0;UBBBrowerInfo.MinorVer=0; }; UBBBrowerInfo.IsIE55OrMore=UBBBrowerInfo.IsIE&&(UBBBrowerInfo.MajorVer>5||UBBBrowerInfo.MinorVer>=5); var UBBScriptLoader=new Object(); UBBScriptLoader.IsLoading=false; UBBScriptLoader.Queue=new Array(); UBBScriptLoader.AddScript=function(scriptPath){ UBBScriptLoader.Queue[UBBScriptLoader.Queue.length]=scriptPath; //if (!this.IsLoading) this.CheckQueue(); }; UBBScriptLoader.CheckQueue=function(){ if (this.Queue.length>0){ this.IsLoading=true; var sScriptPath=this.Queue[0]; var oTempArray=new Array(); for (i=1;i<this.Queue.length;i++) oTempArray[i-1]=this.Queue[i]; this.Queue=oTempArray; var e; if (sScriptPath.lastIndexOf('.css')>0){ e=document.createElement('LINK'); e.rel='stylesheet';e.type='text/css'; } else { e=document.createElement("script"); e.type="text/javascript"; e.language="javascript"; }; document.getElementsByTagName("head")[0].appendChild(e); var oEvent=function(){ if (this.tagName=='LINK'||!this.readyState||this.readyState=='loaded') UBBScriptLoader.CheckQueue();}; if (e.tagName=='LINK'){ if (UBBBrowserInfo.IsIE) e.onload=oEvent;else UBBScriptLoader.CheckQueue(); e.href=sScriptPath; } else{ e.onload=e.onreadystatechange=oEvent;e.src=sScriptPath; }; } else { this.IsLoading=false; if (this.OnEmpty) this.OnEmpty();}; } var EditMethod="normal" var UBBTextArea //UBBBrowerInfo.IsIE 判断是否是IE //UBBBrowerInfo.IsGecko 判断是否是Gecko //初试化代码 if (UBBBrowerInfo.IsIE){ UBBScriptLoader.AddScript('common/UBBCode_IE.js') } if (UBBBrowerInfo.IsGecko){ UBBScriptLoader.AddScript('common/UBBCode_Gecko.js') } UBBScriptLoader.CheckQueue();

  推荐阅读

  js奇偶数判断的代码

有两个变量 a 和 b 如果a=1,3,5,7,9 则b="奇数" 如果a=2,4,6,8 则b="偶数" 如果a="0" 则b="零" [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]>>>详细阅读


本文标题:pjblog中的UBBCode.js

地址:http://www.17bianji.com/kaifa2/JS/30525.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)