เมื่อเราทำโครงการ BBS เราต้องใช้ UBB Editor โดยทั่วไปผู้จัดการแบ็กเอนด์ใช้ตัวแก้ไข CKEditor และชาวเน็ตโดยทั่วไปใช้ตัวแก้ไข UBB หลายคนไม่รู้เกี่ยวกับตัวแก้ไข UBB มากนัก ต่อไปนี้เป็นข้อผิดพลาดตัวแก้ไขใหม่ บรรณาธิการวิเคราะห์ตัวแก้ไข UBB สั้น ๆ สำหรับคุณ
<! doctype html public "-// w3c // dtd html 4.01 transitional // en" "'target = _blank rel = nofollow> http://www.w3.org/tr/html4/loose.dtd"
<html>
<head>
<title> ubb editor </title>
<meta http-equiv = "content-type" content = "text/html; charset = gb2312">>
<link href = "style.css" rel = "stylesheet" type = "text/css">
<ภาษาสคริปต์ = "JavaScript">
-
if (navigator.appname == "Microsoft Internet Explorer"))
-
isie = true;
-
อื่น
-
ISIE = FALSE;
-
ฟังก์ชั่น addText (newCode)
-
if (document.all) {
InsertatCaret (document.ubbform.content, newCode);
document.ubbform.content.focus ();
-
อื่น
-
document.ubbform.content.value += newCode;
document.ubbform.content.focus ();
-
-
ฟังก์ชั่น insertatCaret (textel, text) {
if (textel.createtextrange && textel.caretpos)
-
var caretpos = textel.caretpos;
caretpos.text += caretpos.text.charat (caretpos.text.length - 2) == ''? ข้อความ + '': ข้อความ;
-
อื่นถ้า (TEXTEL)
-
textel.value += ข้อความ;
-
อื่น
-
textel.value = text;
-
-
ฟังก์ชั่น ubbbormat (อะไร)
-
if (document.selection && document.selection.type == "text")
-
ช่วง var = document.selection.createrange ();
range.text = "["+อะไร+"]"+range.text+"[/"+อะไร+"]";
-
อื่น
-
txt = window.prompt ("โปรดป้อนเนื้อหา", "");
ถ้า (txt! = null) {
addtxt = "["+อะไร+"]"+txt;
addText (addtxt);
addText ("[/"+อะไร+"]");
-
-
-
ฟังก์ชั่น ubbinsert (อะไร)
-
if (document.selection && document.selection.type == "text")
-
ช่วง var = document.selection.createrange ();
range.text = "["+อะไร+"]"+range.text+"[/"+อะไร+"]";
-
อื่น
-
txt = window.prompt ("โปรดป้อนเนื้อหา", "");
ถ้า (txt! = null) {
addtxt = "["+อะไร+"]"+txt;
addText (addtxt);
addText ("[/"+อะไร+"]");
-
-
-
ฟังก์ชั่น chsize (ขนาด) {
if (document.selection && document.selection.type == "text")
-
ช่วง var = document.selection.createrange ();
range.text = "[size =" + size + "]" + range.text + "[/size]";
-
อื่น
-
txt = window.prompt ("โปรดป้อนเนื้อหา", "");
ถ้า (txt! = null)
-
addtxt = "[size ="+size+"]"+txt;
addText (addtxt);
addText ("[/size]");
-
-
-
ฟังก์ชั่น chfont (ตัวอักษร) {
if (document.selection && document.selection.type == "text") {
ช่วง var = document.selection.createrange ();
range.text = "" + range.text + "";
-
อื่น
-
txt = window.prompt ("โปรดป้อนเนื้อหา", "");
ถ้า (txt! = null)
-
addtxt = ""+txt;
addText (addtxt);
addText ("");
-
-
-
ฟังก์ชั่น chcolor (สี) {
if (document.selection && document.selection.type == "text") {
ช่วง var = document.selection.createrange ();
range.text = "" + range.text + "";
-
อื่น
-
txt = window.prompt ("โปรดป้อนเนื้อหา", "");
ถ้า (txt! = null) {
addtxt = ""+txt;
addText (addtxt);
addText ("");
-
-
-
-
</script>
</head>
<body>
<รูปแบบวิธี = post name = "ubbform" action = "">
<table allign = "center" border = "0">
<tr>
<td>
<select name = "font" onfocus = "this.selectedIndex = 0" onChange = "chfont (this.options [this.selectedIndex] .Value)" size = "1">
<ตัวเลือกค่า = "" เลือก> เลือกตัวอักษร </potion>
<ตัวเลือกค่า = "宋体"> 宋体 </potion>
<ตัวเลือกค่า = "ตัวหนา"> ตัวหนา </potion>
<ตัวเลือกค่า = "Arial"> Arial </potion>
<option value = "Book Antiqua"> Book Antiqua </petion>
<ตัวเลือกค่า = "ศตวรรษโกธิค"> ศตวรรษโกธิค </portion>
<option value = "Courier ใหม่"> Courier ใหม่ </petion>
<ตัวเลือกค่า = "Georgia"> Georgia </potion>
<ตัวเลือกค่า = "ผลกระทบ"> ผลกระทบ </petion>
<ตัวเลือกค่า = "tahoma"> tahoma </pontion>
<ตัวเลือกค่า = "Times New Roman"> Times New Roman </potion>
<ตัวเลือกค่า = "verdana"> verdana </pontion>
</เลือก>
<select name = "size" onfocus = "this.selectedIndex = 0" onChange = "chsize (this.options [this.selectedIndex] .Value)" size = "1">
<ตัวเลือกค่า = "" ที่เลือก> ขนาดตัวอักษร </portion>
<ตัวเลือกค่า = "-2">-2 </potion>
<ตัวเลือกค่า = "-1">-1 </potion>
<ตัวเลือกค่า = "1"> 1 </potion>
<ตัวเลือกค่า = "2"> 2 </potion>
<ตัวเลือกค่า = "3"> 3 </potion>
<ตัวเลือกค่า = "4"> 4 </potion>
<ตัวเลือกค่า = "5"> 5 </potion>
<ตัวเลือกค่า = "6"> 6 </potion>
<ตัวเลือกค่า = "7"> 7 </potion>
</เลือก>
<select name = "color" onfocus = "this.selectedIndex = 0" onchange = "chcolor (this.options [this.selectedIndex] .Value)" size = "1">
<ตัวเลือกค่า = "" เลือก> สีตัวอักษร </portion>
<ตัวเลือกค่า = "ดำ" style = "พื้นหลังสี: ดำ; สี: ดำ;"> ดำ </portion>
<ตัวเลือกค่า = "สีขาว" style = "พื้นหลังสี: สีขาว; สี: สีขาว;"> สีขาว </petion>
<ตัวเลือกค่า = "สีแดง" style = "พื้นหลังสี: สีแดง; สี: สีแดง"
<ตัวเลือกค่า = "สีเหลือง" style = "พื้นหลังสี: สีเหลือง; สี: สีเหลือง;"> สีเหลือง </portion>
<ตัวเลือกค่า = "Pink" style = "พื้นหลังสี: Pink; Color: Pink;"> Pink </petion>
<ตัวเลือกค่า = "สีเขียว" style = "พื้นหลังสี: สีเขียว; สี: สีเขียว"> สีเขียว </portion>
<ตัวเลือกค่า = "สีส้ม" สไตล์ = "พื้นหลังสี: สีส้ม; สี: สีส้ม;"> สีส้ม </petion>
<ตัวเลือกค่า = "สีม่วง" style = "พื้นหลังสี: สีม่วง; สี: สีม่วง;"> สีม่วง </portion>
<ตัวเลือกค่า = "blue" style = "พื้นหลังสี: สีน้ำเงิน; สี: สีน้ำเงิน"
<ตัวเลือกค่า = "เบจ" สไตล์ = "พื้นหลังสี: สีเบจ; สี: สีเบจ;"> เบจ </opopture>
<ตัวเลือกค่า = "สีน้ำตาล" style = "พื้นหลังสี: สีน้ำตาล; สี: สีน้ำตาล"
<ตัวเลือกค่า = "teal" style = "พื้นหลังสี: teal; color: teal;"> teal </petion>
<ตัวเลือกค่า = "Navy" style = "พื้นหลังสี: Navy; Color: Navy;"> Navy </petion>
<option value = "Maroon" style = "พื้นหลังสี: Maroon; Color: Maroon;"> Maroon </petion>
<ตัวเลือกค่า = "LimeGreen" style = "พื้นหลังสี: LimeGreen; Color: LimeGreen;"> LimeGreen </petion>
</เลือก>
</td>
</tr>
<tr>
<td>
<img src = "ubb/bold.gif" border = "0" alt = "bold" onclick = "ubbbformat ('b')"> <img src = "ubb/italicize.gif" border = "0" alt = alt = "ขีดเส้นใต้" onclick = "ubbbormat ('u')"> <img src = "ubb/center.gif" border = "0" alt = "การจัดตำแหน่งกลาง" onclick = "ubbbformat ('center')"> <img src = "ubb/email.gif" onclick = "ubbbormat ('อีเมล')"> <img src = "ubb/url.gif" border = "0" alt = "แทรก url" onclick = "ubbbormat ('url')"> <img src = "ubb/quote.gif" src = "ubb/wmv.gif" border = "0" alt = "แทรกวิดีโอ" onclick = "ubbformat ('สื่อ')"> <img src = "imporm/image.gif" border = "0" alt = "แทรกแฟลชแอนิเมชั่น" alt = "แทรกรูปภาพ" onclick = "ubbinsert ('img')">>
</td>
</tr>
<tr>
<td> <textarea name = "content" rows = "10" cols = "80"> </textarea> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
ข้างต้นเป็นการวิเคราะห์สั้น ๆ ของเนื้อหาของตัวแก้ไข UBB ฉันหวังว่ามันจะเป็นประโยชน์ต่อการเรียนรู้ของทุกคนและฉันหวังว่าทุกคนจะสนับสนุนช่องเทคโนโลยีใหม่ที่ผิด