µÑÇÍÂèÒ§
|
Code1 ãÊèã¹ Tag <head> Code2 ãÊèã¹ Tag <body> µÃ§·Õèµéͧ¡Òà |
Code1 |
<script LANGUAGE="JavaScript"> <!--http://www.banabana.u4l.com--> function AppendText(str) { document.forms[0].editor.value += str; return; } function EditAppendText(form, type) { strin = "form." + type + ".options[(form." + type + ".selectedIndex)].value"; form.editor.value += eval(strin); return; } function ViewPage(form) { var v_win = open("","HTML_Editor","scrollbars,toolbar=no,directories=no,menubar=yes"); var source = form.editor.value; v_win.document.write(source); v_win.document.close(); return true; } function ClearText(form) { form.editor.value=""; return; } function CallAssistant(form) { eval(form.assist.options[(form.assist.selectedIndex)].value); } function CreateTable(win) { AppendText("<TABLE BORDER=\"1\">\n"); for(row_count = 0; row_count < rows; row_count++) { AppendText("<TR>\n"); for(col_count = 0; col_count < cols; col_count++) { elem = row_count * rows + col_count; string = "<TD>" + win.document.forms[0].elements[elem].value + "</TD>\n"; AppendText(string); } AppendText("</TR>\n"); } AppendText("</TABLE>\n"); win.close(); return; } function TableAssistant(form) { rows = prompt("Number of rows?", "1"); cols = prompt("Number of columns?", "1"); if (rows == null || cols == null) { return true; } t_win = open("","Table_Editor","scrollbars,toolbar=no,directories=no,menubar=yes"); t_win.create = CreateTable; t_win.document.write('<HTML><HEAD><TITLE>Table Editor</TITLE></HEAD><BODY BGCOLOR="white"><FORM><TABLE>'); for(no_of_rows = 1; no_of_rows <= rows; no_of_rows++) { t_win.document.write('<TR>'); for(no_of_cols = 1; no_of_cols <= cols; no_of_cols++) { t_win.document.write('<TD><INPUT TYPE="text"></TD>'); } t_win.document.write('</TR>'); } t_win.document.write('</TABLE><P><INPUT TYPE="button" VALUE="OK" onClick="self.create(self)">'); t_win.document.write('<INPUT TYPE="button" VALUE="Cancel" onClick="self.close()">'); t_win.document.write('</FORM></BODY></HTML>'); t_win.document.close(); return true; } function CreateList(win) { list_type = l_win.document.forms[0].elements[0].options[(l_win.document.forms[0].elements[0].selectedIndex)].value; if (list_type == "disc" || list_type == "circle" || list_type == "square") { string = "<UL TYPE=\"" + list_type + "\">\n"; AppendText(string); } else { string = "<OL TYPE=\"" + list_type + "\">\n"; AppendText(string); } for(items = 1; items <= l_win.document.forms[0].elements.length - 3; items++) { string = "<LI>" + l_win.document.forms[0].elements[items].value + "\n"; AppendText(string); } if (list_type == "disc" || list_type == "circle" || list_type == "square") { AppendText("</UL>\n"); } else { AppendText("</OL>\n"); } win.close(); return true; } function ListAssistant(form) { items = prompt("Number of items in the list?", "1"); if (items == null) { return true; } l_win=open("","List_Editor","scrollbars,toolbar=no,directories=no,menubar=yes"); l_win.create = CreateList; l_win.document.write('<HTML><HEAD><TITLE>List Editor</TITLE></HEAD><BODY BGCOLOR="white"><FORM>'); l_win.document.write('List Indicator: <SELECT><OPTION VALUE="disc">Disc<OPTION VALUE="circle">Circle<OPTION VALUE="square">Square'); l_win.document.write('<OPTION VALUE="1">Numbers<OPTION VALUE="A">Uppercase Letters<OPTION VALUE="a">Lowercase Letters'); l_win.document.write('<OPTION VALUE="I">Uppercase Roman Numerals<OPTION VALUE="i">Lowercase Roman Numerals</SELECT><P>'); for(no_of_items=1; no_of_items <= items; no_of_items++) { l_win.document.write("<INPUT TYPE='text'><BR>"); } l_win.document.write('<P><INPUT TYPE="button" VALUE="OK" onClick="self.create(self)">'); l_win.document.write('<INPUT TYPE="button" VALUE="Cancel" onClick="self.close()">'); l_win.document.write('</FORM></BODY></HTML>'); l_win.document.close(); return true; } function CreateTextOffset(win) { text_offset_type = to_win.document.forms[0].elements[0].options[(to_win.document.forms[0].elements[0].selectedIndex)].value; offset_text = to_win.document.forms[0].elements[1].value; offset_text += "\n"; begin_text_offset_tag = "<" + text_offset_type + ">\n"; end_text_offset_tag = "</" + text_offset_type + ">\n"; AppendText(begin_text_offset_tag); AppendText(offset_text); AppendText(end_text_offset_tag); win.close(); return true; } function TextOffsetAssistant(form) { to_win=open("","Text_Offsets_Editor","scrollbars,toolbar=no,directories=no,menubar=yes"); to_win.create = CreateTextOffset; to_win.document.write('<HTML><HEAD><TITLE>Text Offset Editor</TITLE></HEAD><BODY BGCOLOR="white"><FORM>'); to_win.document.write('Text Offset Type: <SELECT><OPTION VALUE="ADDRESS">ADDRESS<OPTION VALUE="BLOCKQUOTE">BLOCKQUOTE<OPTION VALUE="CODE">CODE'); to_win.document.write('<OPTION VALUE="PRE">PRE</SELECT><P>'); to_win.document.write('<TEXTAREA ROWS="10" COLS="40"></TEXTAREA>'); to_win.document.write('<P><INPUT TYPE="button" VALUE="OK" onClick="self.create(self)">'); to_win.document.write('<INPUT TYPE="button" VALUE="Cancel" onClick="self.close()">'); to_win.document.write('</FORM></BODY></HTML>'); to_win.document.close(); return true; } </script> |
Code2 |
<form NAME="htmlopie"> <p><input TYPE="button" NAME="View" VALUE="View" onClick="ViewPage(this.form)"> <font COLOR="black">Source</font> <input TYPE="button" NAME="Clear" VALUE="Clear" onClick="ClearText(this.form)"><br> <textarea NAME="editor" ROWS="10" COLS="60"> </textarea></p> <table ALIGN="center" CELLSPACING="0" CELLPADDING="0"> <tr> <td ALIGN="center"><font COLOR="black" SIZE="2">Document</font></td> <td ALIGN="center"><font COLOR="black" SIZE="2">Fonts</font></td> <td ALIGN="center"><font COLOR="black" SIZE="2">Offsets</font></td> <td ALIGN="center"><font COLOR="black" SIZE="2">Headers</font></td> <td ALIGN="center"><font COLOR="black" SIZE="2">Anchors/Images</font></td> </tr> <tr> <td ALIGN="center"><select NAME="docs" onChange="EditAppendText(this.form, "docs")" size="1"> <option VALUE="<HTML> "><HTML> </option> <option VALUE="</HTML> "></HTML> </option> <option VALUE="<HEAD> "><HEAD> </option> <option VALUE="</HEAD> "></HEAD> </option> <option VALUE="<TITLE> "><TITLE> </option> <option VALUE="</TITLE> "></TITLE> </option> <option VALUE="<BODY BGCOLOR="" BACKGROUND="" LINK="" ALINK="" VLINK="" TEXT="" > "><BODY> </option> <option VALUE="</BODY> "></BODY> </option> <option VALUE="<META NAME="" HTTP-EQUIV="" CONTENT=""> "><META> </option> <option VALUE="<LINK HREF="" REL="" REV="" TITLE="" > "><LINK> </option> </select> </td> <td ALIGN="center"><select NAME="emphasis" onChange="EditAppendText(this.form, "emphasis")" size="1"> <option VALUE="<B> "><B> </option> <option VALUE="</B> "></B> </option> <option VALUE="<I> "><I> </option> <option VALUE="</I> "></I> </option> <option VALUE="<TT> "><TT> </option> <option VALUE="</TT> "></TT> </option> <option VALUE="<U> "><U> </option> <option VALUE="</U> "></U> </option> <option VALUE="<FONT SIZE="" COLOR=""> "><FONT> </option> <option VALUE="</FONT> "></FONT> </option> </select> </td> <td ALIGN="center"><select NAME="offsets" onChange="EditAppendText(this.form, "offsets")" size="1"> <option VALUE="<PRE WIDTH=""> "><PRE> </option> <option VALUE="</PRE> "></PRE> </option> <option VALUE="<ADDRESS> "><ADDRESS> </option> <option VALUE="</ADDRESS> "></ADDRESS> </option> <option VALUE="<BLOCKQUOTE> "><BLOCKQUOTE> </option> <option VALUE="</BLOCKQUOTE> "></BLOCKQUOTE> </option> </select> </td> <td ALIGN="center"><select NAME="headers" onChange="EditAppendText(this.form, "headers")" size="1"> <option VALUE="<H1 ALIGN=""> "><H1> </option> <option VALUE="</H1> "></H1> </option> <option VALUE="<H2 ALIGN=""> "><H2> </option> <option VALUE="</H2> "></H2> </option> <option VALUE="<H3 ALIGN=""> "><H3> </option> <option VALUE="</H3> "></H3> </option> <option VALUE="<H4 ALIGN=""> "><H4> </option> <option VALUE="</H4> "></H4> </option> <option VALUE="<H5 ALIGN=""> "><H5> </option> <option VALUE="</H5> "></H5> </option> <option VALUE="<H6 ALIGN=""> "><H6> </option> <option VALUE="</H6> "></H6> </option> </select> </td> <td ALIGN="center"><select NAME="anchors" onChange="EditAppendText(this.form, "anchors")" size="1"> <option VALUE="<A HREF="" NAME="" REL="" REV="" TITLE="" > "><A> </option> <option VALUE="</A> "></A> </option> <option VALUE="<IMG SRC="" ALIGN="" ALT="" WIDTH="" HEIGHT="" BORDER="" HSPACE="" VSPACE="" > "><IMG> </option> </select> </td> </tr> <tr> <td ALIGN="center"><font COLOR="black" SIZE="2">Lists</font></td> <td ALIGN="center"><font COLOR="black" SIZE="2">Separators</font></td> <td ALIGN="center"><font COLOR="black" SIZE="2">Forms</font></td> <td ALIGN="center"><font COLOR="black" SIZE="2">Tables</font></td> <td ALIGN="center"><font COLOR="black" SIZE="2">Misc</font></td> </tr> <tr> <td ALIGN="center"><select NAME="lists" onChange="EditAppendText(this.form, "lists")" size="1"> <option VALUE="<UL TYPE=""> "><UL> </option> <option VALUE="</UL> "></UL> </option> <option VALUE="<OL TYPE=""> "><OL> </option> <option VALUE="</OL> "></OL> </option> <option VALUE="<LI TYPE=""> "><LI> </option> <option VALUE="<DL> "><DL> </option> <option VALUE="</DL> "></DL> </option> <option VALUE="<DT> "><DT> </option> <option VALUE="<DD> "><DD> </option> </select> </td> <td ALIGN="center"><select NAME="separators" onChange="EditAppendText(this.form, "separators")" size="1"> <option VALUE="<DIV ALIGN=""> "><DIV> </option> <option VALUE="</DIV> "></DIV> </option> <option VALUE="<HR ALIGN="" SIZE="" WIDTH="" > "><HR> </option> <option VALUE="<BR CLEAR=""> "><BR> </option> <option VALUE="<P ALIGN=""> "><P> </option> <option VALUE="<CENTER> "><CENTER> </option> <option VALUE="</CENTER> "></CENTER> </option> </select> </td> <td ALIGN="center"><select NAME="forms" onChange="EditAppendText(this.form, "forms")" size="1"> <option VALUE="<FORM ACTION="" METHOD="" ENCTYPE=""> "><FORM> </option> <option VALUE="</FORM> "></FORM> </option> <option VALUE="<INPUT TYPE="" NAME="" VALUE="" > "><INPUT> </option> <option VALUE="<SELECT NAME="" SIZE="" > "><SELECT> </option> <option VALUE="<OPTION VALUE=""> "><OPTION> </option> <option VALUE="<TEXTAREA NAME="" ROWS="" COLS=""> "><TEXTAREA> </option> <option VALUE="</TEXTAREA> "></TEXTAREA> </option> </select> </td> <td ALIGN="center"><select NAME="tables" onChange="EditAppendText(this.form, "tables")" size="1"> <option VALUE="<TABLE BORDER="" ALIGN="" WIDTH="" CELLSPACING="" CELLPADDING="" > "><TABLE> </option> <option VALUE="</TABLE> "></TABLE> </option> <option VALUE="<TH ROWSPAN="" COLSPAN="" ALIGN="" VALIGN="" WIDTH="" HEIGHT="" BGCOLOR="" > "><TH> </option> <option VALUE="</TH> "></TH> </option> <option VALUE="<TR ALIGN="" VALIGN=""> "><TR> </option> <option VALUE="</TR> "></TR> </option> <option VALUE="<TD ROWSPAN="" COLSPAN="" ALIGN="" VALIGN="" WIDTH="" HEIGHT="" BGCOLOR="" > "><TD> </option> <option VALUE="</TD> "></TD> </option> <option VALUE="<CAPTION ALIGN=""> "><CAPTION> </option> </select> </td> <td ALIGN="center"><select NAME="misc" onChange="EditAppendText(this.form, "misc")" size="1"> <option VALUE="<MAP NAME=""> "><MAP> </option> <option VALUE="</MAP> "></MAP> </option> <option VALUE="<AREA HREF="" SHAPE="" COORDS="" ALT="" > "><AREA> </option> <option VALUE="<SCRIPT LANGUAGE=""> "><SCRIPT> </option> <option VALUE="</SCRIPT> "></SCRIPT> </option> <option VALUE="<APPLET CODEBASE="" CODE="" ALT="" NAME="" WIDTH="" HEIGHT="" ALIGN="" VSPACE="" HSPACE="" > "><APPLET> </option> <option VALUE="</APPLET> "></APPLET> </option> <option VALUE="<PARAM NAME="" VALUE=""> "><PARAM> </option> </select> </td> </tr> <tr> <td ALIGN="center"><font COLOR="black" SIZE="2">Special Characters</font></td> <td ALIGN="center"><font COLOR="black" SIZE="2">Assistants</font></td> </tr> <tr> <td ALIGN="center"><select NAME="special" onChange="EditAppendText(this.form, "special")" size="1"> <option VALUE="&lt;">< </option> <option VALUE="&gt;">> </option> <option VALUE="&amp;">& </option> <option VALUE="&quot;">" </option> <option VALUE="&nbsp;">nbspace </option> <option VALUE="&reg;">® </option> <option VALUE="&copy;">© </option> </select> </td> <td ALIGN="center"><select NAME="assist" onChange="CallAssistant(this.form)" size="1"> <option VALUE="TableAssistant(document.forms[0])">Tables </option> <option VALUE="ListAssistant(document.forms[0])">Lists </option> <option VALUE="TextOffsetAssistant(document.forms[0])">Text Offsets </option> </select> </td> </tr> </table> </form> |
[ Home ] [ Chatroom ] [ Board 1] [Board 2 ] [ Book ] [ Sourcecode ] [ Free ] [ Servicesite ] [ Link ]