pjblog中的UBBCode.js
更新時間:2007年04月25日 00:00:00 作者:
//|===========================|
//| UBB編輯器JS代碼 1.0 |
//| 作者:舜子(PuterJam) |
//| 版權(quán)所有 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();
//| UBB編輯器JS代碼 1.0 |
//| 作者:舜子(PuterJam) |
//| 版權(quán)所有 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();
相關(guān)文章
JS在Array數(shù)組中按指定位置刪除或添加元素對象方法示例
這篇文章主要給大家介紹了關(guān)于JS在Array數(shù)組中按指定位置刪除或添加元素對象的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家學習或者使用JS具有一定的參考學習價值,需要的朋友們下面來一起學習學習吧2019-11-11
js+HTML5 canvas 實現(xiàn)簡單的加載條(進度條)功能示例
這篇文章主要介紹了js+HTML5 canvas 實現(xiàn)簡單的加載條(進度條)功能,涉及javascript使用時間函數(shù)與canvas繪圖結(jié)合實現(xiàn)進度條的相關(guān)操作技巧,需要的朋友可以參考下2019-07-07
uni-app微信小程序登錄授權(quán)的實現(xiàn)
這篇文章主要介紹了uni-app微信小程序登錄授權(quán)的實現(xiàn),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-05-05
js獲取URL的參數(shù)的方法(getQueryString)示例
getQueryString方法默認返回的是 string如果是int類型,則JS使用的時候,要進行轉(zhuǎn)換一下,下面有個不錯的示例,大家可以參考下2013-09-09

