AjaxÖеÄreadyStateºÍstatus
AjaxÖеķµ»Ø״̬readyStateºÍstatus,ÔÀ´Ã»ÓÐÖØÊÓ¹ýÕâÁ½ÕߵĹØϵ£¬½á¹û½ñÌìд´úÂëʱ³ö²î´íÁË¡£ÎÒµÄÔ´úÂëΪ£º
function requestSome()
{
url=......
xmlHttpRequest.open....
xmlHttpRequest.onreadystatechange = function responseSome();
xmlHttpRequest.send....
}
function responseSome()
{
if(xmlHttpReqeust.readyState == 4)
{
alert(xmlHttpRequest.responseText);
.....
.....
}
}
ÎÒÐèÒªµÃµ½Ò»Ð©ºÏ·¨µÄ·µ»ØÊý¾Ý²¢¶ÔÖ®½øÐд¦Àí£¬µ«·µ»Ø½á¹ûºÜÀëÆ棬ÎÒalert³öµÄ½á¹ûΪ£º<html><head><title>Apache Tomcat/5.5.26 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /xxxxx</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/adminConsolfasdf</u></p><p><b>description</b> <u>The requested resource (/adminConsolfasdf) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.26</h3></body></html>
ÎÒдµÄÒ³ÃæÖÐûÓÐÄĸöÊÇÕâÖÖµÄѽ£¬Ôõô»á·µ»ØÕâÖÖ½á¹û£¬ºÜ¹îÒ죬×îºó²Å·¢ÏÖÕâÊÇtomcat·µ»Ø404µÄ´íÎóÒ³ÃæµÄhtml¡£ÔÒòÊÇÏîÄ¿ÔÚlinuxµÄ·þÎñÆ÷¶Ë×ñѵÄÊÇhttpsÐÒ飬¶øÎҵı¾µØÊÇhttp¡£ÔÀ´µÄAjaxÇëÇóurlÊÇhttps,ËùÒ
Ïà¹ØÎĵµ£º
ÔÚ×öajax¼ÓÔØÒ³ÃæʱÓöµ½ÁËÒ»¸öÎÊÌ⣬дÔÚ±»¼ÓÔØÒ³ÃæheadÀïµÄstyle±ê¼ÇËƺõ×ÜÊÇÎÞЧ¡£Òâʶµ½ÏÖÔÚÊÇÔÚieÖУ¬ÓÚÊÇÎÒתÏòffÖе÷ÊÔ£¬½á¹ûÔÚffÖÐÊÇÓÐЧµÄ¡£ÕâÕæÊÇÆæ¹ÖÁË£¬ÄѵÀffºÍieÔÚ¼ÓÔØÒ³ÃæʱÕæ»áÓв»Í¬µÄ´¦Àí·½Ê½Âð£¿ÕâÖÖ²»Í¬ÔÚʲôµØ·½ÄØ£¿
ÎÒÉè·¨²é¿´ffºÍieÖмÓÔص½ä¯ÀÀÆ÷µÄÔ´´úÂ룬£¨ÓõÄalert(document.getElementById(' ......
±¾ÎÄÊÕ¼¯ÁËһЩÓÐȤ²¢ºÜÓÐÓõÄ×Ô¶¯Ìáʾ½Å±¾£¬ËûÃÇÎÞÂÛ¶ÔÓÚ³õѧÕß»¹ÊÇרҵǰ¶Ë¿ª·¢ÈËÔ±¶¼ÊÇÊÊÓõġ£ÕâЩ½Å±¾°üÀ¨±ê×¼µÄ×Ô¶¯ÌáʾЧ¹û¡¢·Â
del.icio.usЧ¹û¡¢·ÂGoogelЧ¹ûÒÔ¼°Ê¹ÓÃ×Ô¶¯ÌáʾµÄ¸ß¼¶Êý¾Ý±í¹ýÂËЧ¹û¡£
ʹÓÃÒ»¸öºÏÊʵÄ×Ô¶¯Ìáʾ½Å±¾ÓÐЧµÄÌáÉýÄãµÄÍøÕ¾µÄÓû§ÌåÑé¡£
1. Ajax Auto Suggest v.2
AutoSuggest
ÀàÌ ......
jsp »º´æ£¬ html »º´æ£¬ ajax»º´æ,½â¾ö·½·¨
url:http://blog.csdn.net/oklzh/archive/2009/08/14/4445722.aspx
ÓйØÒ³Ã滺´æÎÊÌ⣮Õâ¸öÎÊÌâÉÏÍøÕÒÁ˺ö࣮µ«·¢¾õ¸÷ÖÖ½â¾ö·½·¨£¬¶¼±Ë´Ë·ÖÀ룬ûÓÐһƪͳһµÄ½â¾ö·½·¨£¬±¾È˽üÈÕ£¬Ò²Óöµ½ÁËÒ³Ã滺´æµÄÎÊÌ⣬¸ù¾ÝÍøÉϸ÷Ò³Ã滺´æµÄ½â´ð£¬×öÁËÒ»¸ö×ܽᡣ
1.·þÎñÆ÷¶Ë»º´æµÄÎÊÌâ ......
±Õ°ü¸ÅÄ±Õ°ü¾ÍÊÇÄܹ»¶ÁÈ¡ÆäËûº¯ÊýÄÚ²¿±äÁ¿µÄº¯Êý¡£
ÓÉÓÚÔÚJavascriptÓïÑÔÖУ¬Ö»Óк¯ÊýÄÚ²¿µÄ×Óº¯Êý²ÅÄܶÁÈ¡¾Ö²¿±äÁ¿£¬
Òò´Ë¿ÉÒ԰ѱհü¼òµ¥Àí½â³É“¶¨ÒåÔÚÒ»¸öº¯ÊýÄÚ²¿µÄº¯Êý”¡£
function f1(){
¡¡¡¡¡¡¡¡n=999;
¡¡¡¡¡¡¡¡function f2(){
¡¡¡¡¡¡¡¡¡¡¡¡alert(n);
¡¡¡¡¡¡¡¡}
¡¡¡¡¡¡¡¡return f2;
¡¡¡¡}
......
<script type="text/javascript" language="javascript" src="JS/jquery-1[1].2.3.min.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function(){ //Jquery Ò³Ãæ¼ÓÔØʼþ£¬µ±Ò³Ãæ¼ÓÔØÖ®ºóÊ× ......