·í¦øªA¾¹±Nºô¶¸ê°T¦^¶Ç¦Ü¥Î¤áºÝ®É¡A³q±`·|¦bºô¶¸ê®Æ¤§«e¡A¥ý¶Ç°e¤@¨ÇªíÀY¸ê°T¡A³o¨Ç¸ê°T¥i¥HÅý¥Î¤áºÝªºÂsÄý¾¹ª¾¹D¦p¦ó§e²{©Ò¦¬¨ìªº¸ê®Æ¡C¤U±³oÓ½d¨Ò¡A¨Ï¥Î Response.Redirect ¨Ó¶i¦æÂà§}¡G
¦b¤Wz½d¨Ò¤¤¡A¥un¨Ï¥ÎªÌ¥ô¿ï¤@Ó¿ï¶µ¡Aºô¶§Y·|Âà§}¨ì¬ÛÃöªººô§}¡C¤Wz½d¨Òªºì©lÀɦp¤U¡G
¯S§Onª`·Nªº¬O¡GResponse.Redirect ©Ò¥]§tªº¸ê°T³£¬OÄÝ©óªíÀY¸ê°T¡A¦b Response.Buffer = false ªº±¡ªp¤U¡A³o¨ÇªíÀY¸ê°T¥²¶·¥X²{¦b¥ô¦óºô¶¤º®e¤§«e¡A§_«h´N·|³y¦¨¿ù»~¡C¡]«áÄò·|¦³¸Ô²Ó»¡©ú¡C¡^
¤U±³oÓ½d¨Ò¡A¨Ï¥Î Response.Charset ¶Ç°eºô¶¤å¥óªº½s½X¸ê°T¡G
¤Wz½d¨Òªºì©lÀɦp¤U¡G
¦b¤Wz½d¨Ò¤¤¡A§Ú̸g¥Ñ Response.Charset="x-sjis" ±N¤å¥ó½s½X³]©w¦¨¤é¤å½s½X¡A©Ò¥H¬Ý¤£¨ì¤¤¤å¡C¡]¦pªG§Aªº¨t²Î¨S¦³¦w¸Ë¤é¤å¦r§Î¡AIE ¤]·|¸ß°Ý¬O§_n¦w¸Ë¤é¤å¦r§Î¡C¡^¥u¦³¸g¥Ñ¤â°Ê±Nºô¶½s½X§ï¦¨¡uÁcÅ餤¤å (Big 5)¡v¡A¤~¯à¬Ýªº¨ìºô¶¤¤ªº¤¤¤å¡C
¨ä¹ê¡A¦b¤Wz½d¨Ò¤¤¡Aºô¶©Ò¥]§tªºÀÉ®× head.inc ¤w¸g¦³¦b meta ¼ÐÅÒ¤ºµù©ú charset=big5¡A¥Ñ¦¹¥i¨£ IIS ¦øªA¾¹·|¥H ASP µ{¦¡½X¤ºªº Response.Charset ¬°¥D¡A¦Ó©¿²¤ meta ¼ÐÅÒ¤ºªº³]©w¡C
§Ṳ́]¥i¥H¨Ï¥Î Response ª«¥óªº AddHeader ¤èªk¨Ó¥[¤Jªí³æ¸ê°T¡A¨Ò¦p¡A¦b¤UÓ½d¨Ò¤¤¡A§Ú̦bªí³æ¸ê°T©w¸q¤T¬í«áÂà§}¡A¦]¦¹¤U¦C½d¨Ò·|¦b¤T¬í«áª½±µÂà§}¨ì²MµØ¤j¾Çªºº¶¡A¦p¤U¡G
¤Wz½d¨Òªºì©lÀɦp¤U¡G
¦b¤Wz½d¨Ò¤¤¡A¨Ï¥Î AddHeader ©Ò±o¨ìªº®ÄªG¡A¬O©M¤U¦C HTML ºô¶¤¤ªº <meta> ¼ÐÅÒ©Ò±o¨ìªºÂà§}®ÄªG¬O¤@¼Ëªº¡G
<meta http-equiv="Refresh" content="3; URL=http://www.cs.nthu.edu.tw">¤U±³oÓ½d¨Ò¦C¦L¥X Response ª«¥óªº¦Uөʽ誺¹w³]È¡G
¤Wz½d¨Òªºì©lÀɦp¤U¡G
¨ä¤¤ Response.Status ¬ö¿ýºô¶¦^¶Çªºª¬ºA¡AY¬O¡u200 OK¡v¡A¥Nªí¤@¤ÁµL»~¡C¨ä¥L¥i¯àªº°T®§¤Î¬ÛÃöªº»¡©ú¡A½Ð¨£¤U¦Cªí®æ¡G
ª¬ºA½X ^¤å»¡©ú ¤¤¤å»¡©ú 2xx Success ºô¶¶Ç°e§¹¦¨°e¹F¤§¤u§@¤§ª¬ªp 200 OK; the request was fulfilled. ºô¶¶Ç°e§¹¦¨ 201 OK; following a POST command. ºô¶¶Ç°e§¹¦¨¡A¥Hpost command ®æ¦¡¶Ç°e 202 OK; accepted for processing, but processing is not completed. ºô¶¶Ç°e¤w°e¹F¡A¦ýµ{§Ç¦³°ÝÃD¡AµLªk§¹¾ã°õ¦æµ{§Ç¡C 203 OK; partial information--the returned information is only partial. ºô¶¶Ç°e¤w°e¹F¡A¦ý¦]¬Y¨Ç¦]¯À¥u¯à¦^¶Ç³¡¤À¸ê°T¡C 204 OK; no response--request received but no information exists to send back. ºô¶¶Ç°e¤w°e¹F¡A¦ý¦]¬Y¨Ç¦]¯ÀµLªk¦^¶Ç¸ê°T¡C 3xx Redirection «ØÄ³Âà§}¡I 301 Moved--the data requested has a new location and the change is permanent. ±z©Òn¨Dªººô§}¤w¥Ã¤[¾E²¾¡C 302 Found--the data requested has a different URL temporarily. ±z©Òn¨Dªººô§}¼È®É¾E²¾¡C 303 Method--under discussion, a suggestion for the client to try another location. ±z©Òn¨Dªººô§}¥Ø«e¦³©Òª§Ä³¡A«ØÄ³±z¸Õ¸Õ§Oªº¦ì§} ¡C 304 Not Modified--the document has not been modified as expected. n¶Ç°e¸ê®Æ¤£¦X³W©w¡C 4xx Error seems to be in the client ¥Î¤áºÝºÃ¦³¿ù»~ 400 Bad request--syntax problem in the request or it could not be satisfied. ¦b±zrequestªº »yªk¤¤¦³°ÝÃD¡A«ØÄ³±z×¥¿¡A§_«h¥i¯àµLªk°õ¦æ¡C 401 Unauthorized--the client is not authorized to access data. ¥Î¤áºÝ¥¼¸g±ÂÅv¡AµLªk¶Ç±µ¸ê®Æ¡C 402 Payment required--indicates a charging scheme is in effect. ¥Ø«e°õ¦æ¦¹³B»Ý¥I¶O 403 Forbidden--access not required even with authorization. ¥Ø«e¦¹³B§¹¥þÃö³¬(§Y¨Ï³q¹L»{ÃÒ¥çµLªk³q¦æ) 404 Not found--server could not find the given resource. ¦øªA¾¹µLªk´MÀò¸ê·½ 5xx Error seems to be in the server ¦øªA¾¹ºÝºÃ¦³¿ù»~ 500 Internal Error--the server could not fulfill the request because of an unexpected condition. ¦]¤£¦Wì¦]¡A¦øªA¾¹µLªk°õ¦æ¥Î¤áºÝn¨D 501 Not implemented--the sever does not support the facility requested. ¦øªA¾¹ºÝ¦b§Þ³N¤W¤£¤ä´©¥Î¤áºÝn¨D 502 Server overloaded--high load (or servicing) in progress. ¦øªA¾¹¦]¥I¸ü¹L«¡A¥Ø«eµLªk°õ¦æ¡C 503 Gateway timeout--server waited for another service that did not complete in time. ¦øªA¾¹¦]³B²z¨ä¥Lprocess©Îµ¥«Ý®É¶¡¹L¤[¦Ó¶W¥X®É¶¡
JScript µ{¦¡³]p»PÀ³¥Î¡G¥Î©ó¦øªA¾¹ºÝªº ASP Àô¹Ò![]()