ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[±Ð¾Ç] (±Ð¾Ç²Ä1½g)JavaScript·§»¡»PScript¼ÐÅÒ

[±Ð¾Ç] (±Ð¾Ç²Ä1½g)JavaScript·§»¡»PScript¼ÐÅÒ

JavaScrip¬O¤@ºØºô­¶µ{¦¡À³¥Î»y¨¥¡A¥ÑJavaScript©Ò§¹¦¨ªººô­¶µ{¦¡¨Ã¤£»Ý­n³z¹L¼ÒÀÀºô¸ô¦øªA¾¹(IIS¡FApache¡K)ªº¾÷¨î¨Ó¶}±Ò¡A¦]¬°ÂsÄý¾¹¥»¨­´N¨ã¦³°õ¦æ³o¨Çºô­¶À³¥Îµ{¦¡ªº¯à¤O¡C©Î³\§A·|°Ý¡GJava¬O¤£¬O¤@ºØµ{¦¡»y¨¥¡Hµª®×¬OªÖ©wªº¡A¦Ó¥B¥¦ÁÙ¬OºØ°ª¶¥ªºª«¥ó¾É¦V»y¨¥¡I¥¦ªº»yªk¸òC»y¨¥«Ü¹³¡A¦ýµ{¦¡ªº¼¶¼g«o¤S¤ñC»y¨¥§ó²©ö¡A´«¥y¸Ü»¡¡G¥¦¬OC»y¨¥ªº¶§¬Kª©¡C

HTML(HyperText Markup Language)¶W¤å¥ó¼Ð°O»y¨¥¬Oºc¦¨ºô­¶ªº°ò¦¡A¦ý¬O§Q¥ÎHTML¼Ð°O»y¨¥©Ò¼¶¼g¥X¨Óªººô­¶¬O¦ºªº¡A¤]´N¬O»¡¥¦¨S¦³¤¬°Ê©Ê¡AHTMLºô­¶¤@½s¼g§¹¦¨«á¡Aºô­¶ªº¤º®e¡B¼Ë¦¡¡Kµ¥µ¥´N©T©w¤F¡A°£«D§A¦A½s­×¥¦¡A§_«h¨C¦¸ÂsÄýºô­¶©Ò¬Ýªºµe­±³£±N¬O©T©wªº¡IµM¦Ó¡A­Y¬O¥[¤WJavaScript«á´N¤£¤@¼Ë¤F¡AÁ|­Ó¨Ò¨Ó»¡¡GÂsÄýªÌ¦b¦­¤W8ÂI¨ì¤¤¤È12ÂI®É¨Ó¨ìºô¯¸ÂsÄýºô­¶®É§Úªº­º­¶­I´º±N¬O¬õ¦âªº¡A¦b¨ä¾l®É¶¡¥úÁ{®É¡Aºô­¶­I´º«h¬O¶À¦âªº¡F³o¼Ë²³æªº­I´ºÃC¦âÅܤƫÜÃø¶Ü¡H¤£Ãø¡A¦ý¬O¥ú¾aHTML¼Ð°O»y¨¥¬O°µ¤£¨ìªº¡A°£«D§A¥[¤W¤FJavaScript(·íµM¡A¨Ï¥ÎVBScript¤]¦æ¡A¤£¹L¡A¤£¦b±´°Q½d³ò)¡I

Script¼ÐÅÒ
§Ú­Ì©Ò¼¶¼gªºJavaScript­n©ñ¦b­þ¡H·íµM¬O©ñ¦bºô­¶­ì©l½X¤¤¡A¦ý¬OJavaScriptµ{¦¡½X¥²¶·³Q¥]¬A¦b<Script></Sscript>³o²Õ¼ÐÅÒ¤§¤º¡A¦P®ÉÁÙ¥²¶·¦b<Script>¼ÐÅÒ¤º«ü©ú§Ú­Ì©Ò¨Ï¥Îªººô­¶µ{¦¡À³¥Î»y¨¥¡I
  1. <script language="javascript">

  2. //¦b¦¹¼¶¼g§Ú­Ìªºjavascripttµ{¦¡

  3. </script>
½Æ»s¥N½X
Script¼ÐÅÒ¥i¥H©ñ¦bHTMLºô­¶¤¤ªº¥ô¦ó¦a¤è¡I·í§Ú­Ì©Ò¼¶¼gªºJavaScriptµ{¦¡½X³Q<Script></Sscript>³o²Õ¼ÐÅÒ¥]¬A°_¨Ó¤§«á´NÅܦ¨¤F¤@¤äJavaScriptµ{¦¡¡I¨º³o¤äJavaScriptµ{¦¡À³¸Ó©ñ¦bHTML¤å¥ó(¬°ÁקK»~·|¡A¦b«áÄò¸Ñ»¡¤@«ß±Nºô­¶­ì©l½XºÙ¤§¬°HTML¤å¥ó©Îºô­¶¤å¥ó)ªº­þ­Ó¦ì¸m©O¡Hµª®×¬O¡G³£¥i¥H¡A¤£ºÞ¬O©ñ¦b¤å¥óªº¶}ÀY°Ï(<HEAD></HEAD>¼ÐÅÒ¤§¶¡)©Î¬Oºô­¶¥DÅé°Ï(<BODY></BODY>¼ÐÅÒ¤§¶¡)¡A¥u­n§A°ª¿³´N¦æ¤F°Õ¡I¦ý¡Aµ{¦¡³Ì¦nÁÙ¬O©ñ¦bºô­¶¤å¥ó¦ì¸mªº¤ë«e­±¶V¦n¡A¦]¬°¹q¸£«Ü²Â¡I¥¦¸ÑŪ¤å¥óªº¶¶§Ç¬O¥Ñ¤W¦Ó¤U¨Ì§Ç¸ÑŪ¡A­Y¬O§Ú­Ìªºµ{¦¡»Ý­n³Q¨Ï¥Î¡A¦ý¬O¹q¸£¤SÁÙ¨S¸ÑŪ¨ìµ{¦¡°Ï¬qªº±Ô­z¡A¨º¥i´N¥Xºl§¹³JÅo¡I

¸ê®Æ¿é¥X
¦pªG§Ú­Ì·Q±N¤@¬qHEML¤º®e¡y¿é¥X¡z¨ìºô­¶¤¤¡A ¨º¸Ó«ç»ò°µ©O¡H¦b¼Ð·ÇªºHTML¤å¥ó¤¤§Ú­Ì·|±Ä¥Î¤U¦Cªº¤èªk¡Gª½±µ¦b<body></body>¼ÐÅÒ¤§¶¡Áä¤J§Ú­Ì©Ò­n§e²{ªº¤º®e (¥»¨Ò¬°¿é¥X¤å¦r¡¨ºô­¶¥DÅ顨)¡G
  1. <html>
  2. <head>
  3. <title>¸ê®Æ¿é¥X</title>
  4. </head>

  5. <body>
  6. ºô­¶¥DÅé
  7. </body>
  8. </html>
½Æ»s¥N½X
¦b¤W¨Ò¤¤¡A§Ú­Ì¨Ï¥Î©T©w¦¡ªº¶Ç²Î¼gªk¡A¤]´N¬O¦bHTML¤å¥ó¤¤ª½±µÁä¤J±ý¥X²{¦bºô­¶¤¤ªº¤å¦r¡¦ºô­¶¥DÅ顦¡A­Y§Ú­Ì·Q§ï±ÄJavaScriptµ{¦¡¿é¥Xªº¤è¦¡¨Ó¹F¨ì¬Û¦Pªºµ²ªG¡A¨º§Ú­Ì´N¥i¥H§Q¥ÎJavaScriptªº¿é¥X¨ç¦¡¡A¨ä¼Ð·Ç®æ¦¡¦p¤U©Ò¥Ü¡G
  1. document.write("¿é¥X¸ê®Æ¤º®e");
½Æ»s¥N½X
¤W¦¡¤¤¡A§Ú­Ì©Ò­n¿é¥Xªº¸ê®Æ¥²¶·¨Ï¥ÎÂù¤Þ¸¹¥]¬A°_¨Ó¡A¤]´N¬O»¡¡AÂù¤Þ¸¹ªº¤º®e±N·|³Q¿é¥X¨ìºô­¶¤¤¡G
  1. <html>
  2. <head>
  3. <title>¸ê®Æ¿é¥X</title>
  4. </head>

  5. <body>
  6. <script language="javascript">
  7. document.write("ºô­¶¥DÅé");//¦bºô­¶¤¤¿é¥X"ºô­¶¥DÅé"¥|­Ó¦r
  8. </script>
  9. ºô­¶¥DÅé
  10. </body>
  11. </html>
½Æ»s¥N½X
·íµM¡A§Ú­Ì©Ò¿é¥Xªº¸ê®Æ¤]¥i¥H¥]§t¦³HTML¼ÐÅÒ¡A¨Ò¦p¡G§Ú­Ì§Æ±æ§e²{¦bºô­¶¤¤ªº¬O¤@¬q¸m¤¤¹ï»ôªº¬õ¦â¤å¦r¦r¦ê¡G
  1. <body>
  2. <script language="javascript">
  3. document.write("<center><font color='red'>ºô­¶¥DÅé</font>");
  4. //¦bºô­¶¤¤¿é¥X¦ì¸m¤ô¥­¸m¤¤¥BÃC¦â¬°¬õ¦âªº"ºô­¶¥DÅé"¥|­Ó¦r
  5. </script>
  6. </body>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD