Ú
NCAg¤XNvgÆÍAHTML¶ÆAg·é©AܽͶɼÚgÜêéæ¤ÈvO̱ÆÅ éB±ÌvOÍA¶ªNCAg«ÉÇÝÜêéÛÉÀs³ê½èANªANeBuÉÈÁ½ÛÈÇÉÀs³ê½è·éBHTMLªXNvgðT|[g·éû@ÍAXNvg¾êÌíÊ©çÍƧŠéB
XNvgðp¢éÆAÒÍAHTML¶ðxÉ®Iɵ½èÎbIɵ½è·éûüÅg£Å«éBáð°æ¤B
ÒªHTML¶ÉYtÅ«éXNvgÉÍA2ÂÌíÞª éB
ÓB {dlÉÍAXNvgÉÖAµÄA XNvg}NÉ¢ÄÌÚ×îñª éB
ȺÌeßÅÍAXNvgðT|[g·é[UG[WFgÉÖW·éàeðྷéB
<!ELEMENT SCRIPT - - %Script; -- script statements --> <!ATTLIST SCRIPT charset %Charset; #IMPLIED -- char encoding of linked resource -- type %ContentType; #REQUIRED -- content type of script language -- src %URI; #IMPLIED -- URI for an external script -- defer (defer) #IMPLIED -- UA may defer execution of script -- >
Jn^O: K{AI¹^O: K{
®«è`
Êrè`ª 鮫
SCRIPTvfÍAHTML¶ÉXNvgðgÝÞàÌÅA HEADvf é¢Í BODYvfÉA½ño»µÄàæ¢B
XNvgÍA±Ì SCRIPTvfÌàe©AܽÍOt@CÅè`³êéB src®«ÌÝèªÈ¢êA[UG[WFgÍYvfÌàeðXNvgÅ éÆðߵȯêÎÈçÈ¢B src®«ÌlªURI¾Á½êA[UG[WFgÍYvfàeð³µA±ÌURI©çXNvgðæ¾·éKvª éB charset®«Åwè³êĢ鶻û@Ísrc®«ª¦·XNvgÌ»û@ð¦µÄ¢ÄAY SCRIPTvfÆͳÖWÅ é±ÆÉAӳ꽢B
XNvgÍXNvgGWÉæÁÄ]¿³êéBXNvgGWÍ[UG[WFgÉÆÁÄùmÅȯêÎÈçÈ¢B
XNvgf[^ÌV^NXÍeXNvg¾êÉ˶·éB
HTMLÍÁèXNvg¾êÉ˶µÈ¢½ßAÒÍ[UG[WFgÉεAeXNvg̾ê𾦵ȯêÎÈçÈ¢BXNvg¾êÍAftHgé¾ÆÇé¾Ìoûž¦·é±ÆªÅ«éB
ÒÍA¶Ì·×ÄÌXNvgÌftHgÅ éXNvg¾êðA HEADvfÌ METAé¾ÅAÌæ¤ÉwèµÈ¯êÎÈçÈ¢B
<META http-equiv="Content-Script-Type" content="type">
±ÌtypeÍAXNvg¾êð¦·MIME^CvÅAá¦ÎAutext/tclvAutext/javascriptvAutext/vbscriptvÅ éB
META龪¶ÝµÈ¢êAftHgÍuContent-Script-TypevHTTPwb_ÅwèÅ«éB
Content-Script-Type: type
±ÌtypeàAXNvg¾êð¦·MIME^CvÅ éB
[UG[WFgÍAÌDæÊÉ]ÁÄftHgÌXNvg¾êðè·éKvª éB
ftHgÌXNvg¾êðwèµÄ¢È¢¶Å gÝCxgXNvgªwè³ê½vfðÜÞàÌÍAs³Å éB[UG[WFgͱêððßµæ¤ÆÝÄà梪AðßðÝéæ¤v³êéí¯ÅÍÈ¢B I[TOc[ÍAÒªs³È¶ðìçȢŷÞæ¤AftHgXNvg¾êÌîñ𶬷éKvª éB
¶ÌÇÌ SCRIPTvfCX^XàAtype®«ªwè³êĢȯêÎÈçÈ¢B éSCRIPTvfÌtype®«lÍAYvfÌftHgXNvg¾êðã«·éB
ÌáÍAftHgÌXNvg¾êðutext/tclvÆ龵ĢéBwb_ÉÍSCRIPTvfª1 èA±êÍOt@CÌAtext/vbscriptÅ éXNvgðp¢éB{¶É éSCRIPTvfÌàeÍAtext/javascriptÅL³êÄ¢éB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <TITLE>XNvgª é¶</TITLE> <META http-equiv="Content-Script-Type" content="text/tcl"> <SCRIPT type="text/vbscript" src="http://someplace.com/progs/vbcalc"> </SCRIPT> </HEAD> <BODY> <SCRIPT type="text/javascript"> cJavaScriptÌXNvgc </SCRIPT> </BODY> </HTML>
eXNvg¾êÉÍAXNvgà©çHTML¶IuWFNgðQÆ·é½ßÌKñª¶Ý·éB{dlÍAHTML¶IuWFNgðQÆ·é½ßÌW@\ðè`·éàÌÅÍÈ¢B
µ©µÈªçAXNvg©çvfÖÌQÆÍAvf¼É]íËÎÈçÈ¢BXNvgGWÍAvfð¯Ê·éÛÉÌDæîÉ]¤Kvª éBܸAname®«Æ id®«ÌoûªÝè³êÄ¢éêÍname®«ªDæ·éBÉAÇ¿ç©êûÌêÍA éûðp¢éB
ÓB HTML¶ÌÒÖ̾BgÝCxgÌÌæÅÍAá¦ÎXNvgÆCxgÆÌû@ÈÇApÉÉÏXª è¾éB±ÌÌæ̤ÍAW3C̶IuWFNgfìÆÇÌo[ªsÈÁÄ¢éBæèÚµ¢îñÍW3CÌWebTCg http://www.w3.org/ žçêéB
®«è`
[Uª[UG[WFgÆÎb·éÛɶ·é¡ÌCxgÆ1ÂÌ®ìðѯé±ÆàÂ\Å éBãÉñµ½ugÝCxgvÍÇêàAXNvgðlÉæéB±ÌXNvgÍAYvfÉÖW·éCxgª¶·éxÉíÉÀs³êéB XNvgf[^ÌV^NXÍAeXNvg¾êÉ˶·éB
tH[ÌRg[vfÅ éAINPUT, SELECTABUTTONA TEXTAREAAÀÑÉLABELvfÍA·×Ľç©ÌgÝCxgɽ·éB±êçÌvfªtH[ÌOÉo»·éêA±êͶÌOtBJÈ[UC^[tF[Xð·é½ßÉgíêÄ¢éÆvíêéB
á¦ÎAANeBuÉÈÁ½ÛÉAtH[ðño·éÌÅÍÈ¢ªT[oÆðMð·éæ¤Èµ{^ð¶Égݽ¢Æl¦éÒà ë¤B
±±ÅAgÝÝCxgÉîÃ[UC^[tF[X@\ÆpÂ\ÈRg[Ìáðô©¦·B
ÌáÅÍAuserNameÖÌeLXgüͪv³êéB[UªüÍtB[hð£êæ¤Æ·éÛA onblurCxgªJavaScriptÌÖðÄÑoµAuserNameÉKØÈlªüͳêÄ¢é©Ç¤©ªè³êéB
<INPUT NAME="userName" onblur="validUserName(this.value)">
XÉÊÌJavaScriptÌáð¦·B
<INPUT NAME="num" onchange="if (!checkNum(this.value, 1, 10)) {this.focus();this.select();} else {thanks()}" VALUE="0">
¡xÍeLXgtB[hÌCxgnhÅ éVBScriptÌáð¦·B
<INPUT name="edit1" size="50"> <SCRIPT type="text/vbscript"> Sub edit1_changed() If edit1.value = "abc" Then button1.enabled = True Else button1.enabled = False End If End Sub </SCRIPT>
±êðTclɵ½áð¦·B
<INPUT name="edit1" size="50"> <SCRIPT type="text/tcl"> proc edit1_changed {} { if {[edit value] == abc} { button1 enable 1 } else { button1 enable 0 } } edit1 onChange edit1_changed </SCRIPT>
±¢ÄAXNvgÌLqàeÉCxgðgñ¾JavaScriptÌáð¦·BܸAPÈNbNnhÌáB
<BUTTON type="button" name="mybutton" value="10"> <SCRIPT type="text/javascript"> function my_onclick() { . . . } document.form.mybutton.onclick = my_onclick </SCRIPT> </BUTTON>
ÉAवʢEChEnhÌáB
<SCRIPT type="text/javascript"> function my_onload() { . . . } var win = window.open("some/other/URI") if (win) win.onload = my_onload </SCRIPT>
±êÍTclÅÍÌæ¤ÉÈéB
<SCRIPT type="text/tcl"> proc my_onload {} { . . . } set win [window open "some/other/URI"] if {$win != ""} { $win onload my_onload } </SCRIPT>
±±ÅAgÝCxgnhÌudocument.writev é¢Í±êƿȽ߶ªA»Ý̶ðXV·éÌÅÍÈVµ¢¶ð쬷éÌÅ é_Éӳ꽢B
¶ÌÇÝÝƯÉÀs³êéXNvgÍA¶Ìàeð®IÉÏXÅ«éB±ÌÏX\ÍÍAXNvg¾ê©ÌÉ˶·éBá¦ÎA¡Ìx_[ªHTMLIuWFNgfÌudocument.writev½ß¶ðT|[gµÄ¢éB
¶Ì®IÏXÍAÌæ¤Éf»Å«éB
HTML¶ÍAÇÌSCRIPTvfÌOàãàAHTML DTDÉK·é椧ñ³êéB
ÌáÍAXNvgª¶ðÇÌæ¤É®IÉÏX·é©ð¦·B
<TITLE>eXg¶</TITLE> <SCRIPT type="text/javascript"> document.write("<p><b>Hello World!<\/b>") </SCRIPT>
ãÌXNvgÍAÌHTML}[Nt¯Æ¯ÌøÊðÁÄ¢éB
<TITLE>eXg¶</TITLE> <P><B>Hello World!</B>
±ÌßÅÍAÒªAXNvgðT|[gµÈ¢[UG[WFgÅ@\·é¶ðÇÌæ¤Éìê΢¢©ðྷéB
<!ELEMENT NOSCRIPT - - (%block;)+ -- alternate content container for non script-based rendering --> <!ATTLIST NOSCRIPT %attrs; -- %coreattrs, %i18n, %events -- >
Jn^O: K{AI¹^O: K{
NOSCRIPTvfðg¤ÆAÒÍAXNvgªÀs³êÈ¢ÛÌãÖàeðñÅ«éB XNvgðF¯·é[UG[WFgÍA NOSCRIPTvfÌàeðAÌêɵ©_OµÄÍ¢¯È¢B
NCAg¤XNvgðT|[gµÄ¢È¢[UG[WFgÍA±ÌvfÌàeð_OµÈ¯êÎÈçÈ¢B
ÌáÅÍASCRIPTðÀs·é[UG[WFgÍ®Iɶ¬µ½f[^ð¢Â©¶ÉgÝAXNvgðT|[gµÈ¢[UG[WFgÅàA[UÍNðʶÄf[^ðæ¾Å«éB
<SCRIPT type="text/tcl"> cf[^ðgÞ½ßÌTclXNvgc </SCRIPT> <NOSCRIPT> <P><A href="http://someplace.com/data">data.</A>ÉANZX³ê½µB </NOSCRIPT>
SCRIPTvfðF¯µÈ¢[UG[WFgÍAvfÌàeðeLXgƵÄ_Oµæ¤Æµª¿Å éB JavaScriptAVBScriptAÀÑÉTclðÜޢ©ÌXNvgGWÍAXNvg̽߶ðSGMLRgÉÍ¢Þ±ÆðeµÄ¢éB »±ÅASCRIPTvfðF¯µÈ¢[UG[WFgÍRgð³·éªA}gÈXNvgGWÍRgÌXNvgðÀs·éKvª é±Æðð·éB
âèðð·éÊÌû@ÍAXNvgðO¶ÆµA src®«ÅQÆ·é±ÆÅ éB
JavaScriptÅÌRg»XNvg
JavaScriptGWÍASCRIPTvfÌnßɶñu<!--vª¶Ý·é±ÆðeµA±ÌêYsÌöÜÅ̶ð³·éB
JavaScriptÍAu//vðYsÌöÜűRgÌJnÅ éÆðß·éB±Ìu//vÍAySGMLRgð¶éz¶ñu-->vðJavaScriptp[T©çB·½ßÉKvƳêéB
<SCRIPT type="text/javascript"> <!-- to hide script contents from old browsers function square(i) { document.write("The call passed ", i ," to the function.","<BR>") return i * i } document.write("The function returned ",square(5),".") // end hiding contents from old browsers --> </SCRIPT>
VBScriptÅÌRg»XNvg
VBScriptÅÍAPøpÉæÁÄAYsÌcè̪ªRgƵĵíêé±ÆÆÈéB»±ÅAPøpªAVBScriptÅu-->vðB·½ßÉgíêéB
<SCRIPT type="text/vbscript"> <!-- Sub foo() ... End Sub ' --> </SCRIPT>
TclÅÌRg»XNvg
TclÅÍAu#vªYsÌcè̪ðRgÆ·éB
<SCRIPT type="text/tcl"> <!-- to hide script contents from old browsers proc square {i} { document write "The call passed $i to the function.<BR>" return [expr $i * $i] } document write "The function returned [square 5]." # end hiding contents from old browsers --> </SCRIPT>
ÓB uEUÌÉÍAÅÌu>vÆ¢¤¶ÅRgð¶éàÌà éB±¤µ½uEU©çXNvgàeðB·½ßÉÍAá¦Îux > yvÅÍÈuy < xvÆL·ÈÇAÖWZqâÚ®Zqɨ¢ÄíZqðÚ·éÆ¢Á½è@âAeXNvg¾êÅLÌû@Åu>vðGXP[v·éÆ¢Á½è@ªæè¾éB