Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

AjaxµÄÒì²½ºËÐÄ£ºXMLHTTPRequest

    XMLHTTPRequestÊÇÒÀ¸½ÓÚä¯ÀÀÆ÷µÄÒ»¸ö×é¼þ£¬ä¯ÀÀÆ÷²»Í¬Õë¶ÔµÄ×é¼þÃû³ÆÒ²²»Í¬¡£XMLHTTPRequestÊÇFirefoxÖÐ×é¼þµÄÃû³Æ£¬ÔÚIEÖнÐXMLHTTP¡£“XMLHTTP”ÓÐÁ½¸öÓŵ㣺¾Ö²¿Ë¢Ð¡¢Òì²½¶ÁÈ¡¡£
AjaxµÄʵÏÖ²½Ö裺
1¡¢ ´´½¨Òì²½¶ÔÏó£º
ÔÚIEÖУºvar xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
ÔÚFirefoxÖУºvar xmlhttp = new XMLHttpRequest;
2¡¢ ¼ÓÔØÊý¾ÝËùÔڵķþÎñÆ÷£º
Ajax»ñÈ¡Êý¾Ý¿ÉÒÔ´ÓÆäËûÍøÕ¾»ñÈ¡£¬Ò²¿ÉÒÔ´Ó±¾µØµÄXMLÎļþ»ñÈ¡£¬¼ÓÔØÊý¾Ý·þÎñÆ÷µÄÓï·¨£ºxmlhttp.open(method, url, aysc);
method£º±íʾÏò·þÎñÆ÷·¢ËÍÇëÇóµÄ·½·¨£¬ÓÐ5ÖÖÀàÐÍ£ºGET¡¢POST¡¢HEAD¡¢PUT¡¢DELETE¡£×î³£ÓõÄÊÇGETºÍPOST¡£ ×¢Ò⣺Èç¹ûÊý¾Ý´¦Àí²»¸Ä±äÄ£Ð͵Ä״̬£¨±ÈÈç»ñÈ¡Êý¾Ý£©¾ÍÓÃGET£¬Èç¹û±à¼­¡¢¸üÐÂÊý¾ÝµÈ£¬ÔòÓÃPOST¡£
Aysc±íʾÊÇ·ñʹÓÃÒì²½·½Ê½»ñÈ¡Êý¾Ý£¬Èç¹ûÊÇtrue£¬ÔòXMLHTTP½«Òì²½µ÷ÓöÔÏó¡£
3¡¢ Òì²½µ÷Ó÷þÎñÆ÷״̬µÄ±ä»¯£º
Ò»µ©·þÎñÆ÷Óë¿Í»§¶Ë½øÐн»»¥£¬Òª¿ØÖÆ¿Í»§¶ËµÄ±ä»¯£¬¾ÍÐèÒªÅжÏÄ¿Ç°½»»¥µÄ״̬¡£ËùÒÔÔÚÒì²½µ÷ÓÃ֮ǰÐèÒª½«×´Ì¬±ä»¯µÄʼþonreadystatechangeÓëjavascript¶¨ÒåµÄ·½Ê½¹Ò¹³¡£
xmlhttp.onreadystatechange = ·½·¨Ãû;  ×¢Ò⣺·½·¨ºóÃæ²»¼ÓÀ¨ºÅ¡£
ÏÂÃæÊÇÒì²½µ÷ÓÃÔÚÓë·þÎñÆ÷½»»¥Ê±µÄ5ÖÖ״̬£º
0   δ³õʼ»¯          Òì²½¶ÔÏó´´½¨Íê±Ï£¬²¢Î´Ê¹ÓÃopen·½·¨¡£
1   ³õʼ»¯            Òì²½¶ÔÏó´´½¨Íê±Ï£¬²¢Î´Ê¹ÓÃsend·½·¨·¢ËÍÇëÇó¡£
2   ·¢ËÍÊý¾Ý          send·½·¨Íê³É£¬ÕýÔڵȴý·þÎñÆ÷ÏìÓ¦¡£
3   Êý¾ÝÕýÔÚ·¢ËÍ      ÕýÔÚ½ÓÊÜÊý¾Ý£¬µ«²¢Î´Íê³É¡£
4   Òì²½µ÷ÓÃÍê³É      µ÷ÓÃÍê³É£¬¿ÉÒÔʹÓÃresponseText»îresponseXML»ñÈ¡Êý¾Ý¡£
 
4¡¢ ·¢ËÍÒ»¸öHTTPÇëÇó£º
¼ÓÔØÍêÇëÇóµÄ·þÎñÄÚÈݺ󣬻¹ÐèÒª·¢ËÍÒ»¸öHTTPÇëÇó£¬Ò»°ã±íʾÇëÇóµÄÊý¾Ý¡£Í¨¹ý·¢ËÍÇëÇóʱÉèÖõIJÎÊý£¬À´ÓÐÑ¡ÔñµÄÌôÑ¡Êý¾Ý£º
xmlhttp.send(params);
µ±ÏµÍ³µ÷ÓÃsend·½·¨ºó£¬ºǫ́Óë·þÎñÆ÷µÄ½»»¥²ÅÕæÕý¿ªÊ¼£¬×´Ì¬±àºÅ¾Í¿ªÊ¼±ä»¯¡£
5¡¢ ´¦ÀíÒì²½»ñÈ¡µÄÊý¾Ý£º
×îÖÕ¿Í»§¶Ë»ñÈ¡µÄÊý¾ÝÖ÷ÒªÓÐÁ½ÖÖ£ºÎı¾ÐͺÍXMLÀàÐÍ¡£Îı¾ÐÍÊý¾ÝÓÃxmlhttp.responseText»ñÈ¡£»XMLÀàÐÍʹÓÃxmlhttp.responseXML»ñÈ¡¡£
ÏÂÃæ¾ÙÒ»¸öʹÓÃA


Ïà¹ØÎĵµ£º

ASP.NET—AJAXÉÏ´«µ½·þÎñÆ÷³öÏÖsys䶨Òå

 ¡¡¡¡Ê×Ïȼì²éWeb.configÎļþÀïÊÇ·ñÊÇÈçÏ´úÂ룺
¡¡¡¡´ò¿ªVS2005´´½¨ÐÂÏîÄ¿£¬Ñ¡ÔñASP.NET¡¡AJAXÏîÄ¿£¬È»ºó°Ñ¸ÃÏîÄ¿Web.configÎļþµÄÄÚÈÝÈ«²¿¸´ÖƵ½Ä㱨´íµÄWeb.configÎļþÀï¡£
¡¡¡¡Èç¹ûÕâ¸ö°ì·¨Î´Äܽâ¾ö°ì·¨Çë²é¿´¸ÃÏîÄ¿¸ùĿ¼µÄBinÎļþ¼ÐÄÚÊÇ·ñÓÐSystem.Web.Extensions.Design.dll¡¢System.Web.Extensions.dll¡¢A ......

´«ÖDz¥¿ÍAjaxÊÓƵǰʮ¼¯ÊÓƵËæ±Ê

 +++++++++++++++++++++++Ajax
~~~~~~~~~~~~~~~~~~~~~~~~~~
=======  Ajax ¼¼Êõ  ========
Ò»¡¢µÚÒ»¿Î    ===¡· AJAX¸ÅÊöÓëIntelliJ°²×°
a.Ajax¶Á·¨Æäʵ²»ÊÇÎÒÃǶÁµÄ'°¢¼Ù¿Í˹'£¬×¢Òâרҵ»¯¡£
b.ÍõÐË¿ýÀÏʦÏȽ²Êµ¼ùÔÙ½²ÀíÂÛ¡£
c.¿ª·¢¹¤¾ß²»ÔÙÊÇeclipseÁË£¬ÒòΪajaxÖ÷Ҫдjavascript
d ......

AJAXÔÚPHPÖеļòµ¥Ê¹ÓÃ

¡¡[AJAX½éÉÜ]
¡¡¡¡AjaxÊÇʹÓÿͻ§¶Ë½Å±¾ÓëWeb·þÎñÆ÷½»»»Êý¾ÝµÄWebÓ¦Óÿª·¢·½·¨¡£WebÒ³Ãæ²»Óôò¶Ï½»»¥Á÷³Ì½øÐÐÖØмӲ㬾ͿÉÒÔ¶¯Ì¬µØ¸üС£Ê¹ÓÃAjax£¬Óû§¿ÉÒÔ´´½¨½Ó½ü±¾µØ×ÀÃæÓ¦ÓõÄÖ±½Ó¡¢¸ß¿ÉÓᢸü·á¸»¡¢¸ü¶¯Ì¬µÄWebÓû§½çÃæ¡£
¡¡¡¡Òì²½JavaScriptºÍXML£¨AJAX£©²»ÊÇʲôм¼Êõ£¬¶øÊÇʹÓü¸ÖÖÏÖÓм¼Êõ——°ü ......

΢ÈíÐû²¼AJAX CDN

 Ô­ÎĵØÖ·¡¿Announcing the Microsoft AJAX CDN
¡¾Ô­ÎÄ·¢±íÈÕÆÚ¡¿ Tuesday, September 15, 2009 11:46 PM
½ñÌìÔçЩʱºò£¬ASP.NET¿ª·¢ÍŶÓÍƳöÁËÒ»¸öеÄ΢ÈíAjax CDN£¨Content Delivery Network£¬ÄÚÈÝ·Ö·¢ÍøÂ磩·þÎñ£¬¸Ã·þÎñÌṩÁ˶ÔAJAX¿â£¨°üÀ¨jQuery ºÍ ASP.NET AJAX£©µÄ»º´æÖ§³Ö¡£¸Ã·þÎñÊÇÃâ·ÑµÄ£¬²»ÐèÈκÎ×¢² ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ