ajaxÔÀí
ajaxÈ«³ÆAsynchronous JavaScript and Xml ,Òì²½´«Êä¡£
Òì²½´«ÊäÊÇÃæÏò×Ö·ûµÄ´«Ê䣬ËüµÄµ¥Î»ÊÇ×Ö·û£»¶øͬ²½´«ÊäÊÇÃæÏò±ÈÌصĴ«Ê䣬ËüµÄµ¥Î»ÊÇÖ¡£¬Ëü´«ÊäµÄʱºòÒªÇó½ÓÊÜ·½ºÍ·¢ËÍ·¢µÄʼÖÕ±£³ÖÒ»Öµġ£
Òì²½´«ÊäÊǽ«±ÈÌØ·Ö³ÉС×éÀ´½øÐд«Êä¡£Ò»°ãÿ¸öС×éµÄÒ»¸ö8λ×Ö·û£¬ÔÚÿ¸öС×éµÄÍ·²¿ºÍβ²¿¶¼ÓÐÒ»¸ö¿ªÊ¼Î»ºÍÒ»¸ö½áÊø룬ËüµÄ´«Êä¹ý³ÌÖнÓÊÕ·½ºÍ·¢ËÍ·½Ê±ÖÓ²»ÒªÇóÒ»Ö¡£Òì²½´«Êä´æÔÚµÄÒ»¸öÎÊÌ⣺¼´½ÓÊÕ·½²»ÖªµÀÊý¾ÝʲôʱºòÄܵ½´ï¡£
ÒòΪÿ´ÎÒì²½´«ÊäµÄÐÅÏ¢¶¼ÒÔÒ»¸öÆäʵΪ¿ªÍ·£¬Ëü֪ͨ½ÓÊÕ·½Êý¾ÝÒѵ½£¬Õâ¾Í¸øÁ˽ÓÊÕ·½ÏìÓ¦¡¢½ÓÊպͻº´æÊý¾Ý±ÈÌصÄʱ¼ä£»ÔÚ´«Êä½áÊøʱ£¬Ò»¸öֹͣλ±íʾ¸Ã´Î´«ÊäÐÅÏ¢µÄÖÕÖ¹¡£
ͬ²½´«ÊäµÄ±ÈÌØ·Ö×éÒª´óµÃ¶à¡£Ëü²»ÊǶÀÁ¢µØ·¢ËÍÿ¸ö×Ö·û£¬Ã¿¸ö×Ö·û¶¼ÓÐ×Ô¼ºµÄ¿ªÊ¼Î»ºÍֹͣ룬¶øÊÇ°ÑËüÃÇ×éºÏÆðÀ´Ò»Æð·¢ËÍ¡£ÎÒÃǽ«ÕâЩ×éºÏ³ÆΪÊý¾ÝÖ¡£¬»ò¼ò³ÆΪ֡¡£
ajaxÔÀíºÍxmlhttprequest¶ÔÏó
ajaxÔÀíÊÇͨ¹ýxmlhttprequest¶ÔÏóÀ´Ïò·þÎñÆ÷·¢ËÍÇëÇ󣬴ӷþÎñÆ÷¶Ë»ñµÃÊý¾Ý£¬È»ºóÓÃJavaScriptÀ´²Ù×÷DOM¸üÐÂÒ³Ãæ¶ÔÏó¡£ÆäÖйؼüÒ»²½¾ÍÊÇ´Ó·þÎñÆ÷»ñµÃÇëÇóÊý¾Ý¡£
xmlhttprequestÊÇajaxºËÐÄ»úÖÆ£¬
xmlhttprequest¶ÔÏóµÄÊôÐÔ£º
onreadstatechange ÿ´Î״̬¸Ä±äËù´¥·¢Ê¼þµÄʼþ´¦Àí³ÌÐò
responseText ´Ó·þÎñÆ÷·µ»ØµÄÊý¾ÝµÄ×Ö·û´®ÐÎʽ
responseXML ´ÓÊý¾Ý¿â·µ»ØµÄDOM¼æÈݵÄÎĵµÊý¾Ý¶ÔÏó
statue ´Ó·þÎñÆ÷·µ»ØµÄ´úÂ룬´ú±í״̬£¨200 ¾ÍÐ÷ 404δÕÒµ½£©
readstate ¶ÔÏó״ֵ̬
0 δ³õʼ»¯--¶ÔÏóÒѾ½¨Á¢£¬µ«ÊÇÉÐδ³õʼ»¯£¨ÉÐδµ÷ÓÃopen·½·¨£©
1³õʼ»¯ ---- ¶ÔÏó½¨Á¢£¬µ«ÊÇÉÐδµ÷ÓÃsend·½·¨
2Êý¾Ý·¢ËÍ---send·½·¨ÒÔµ÷Ó㬵«Êǵ±Ç°µÄ״̬ºÍhttpͷδ֪
3 Êý¾Ý´«ÊäÖÐ--½ÓÊÕ²¿·ÖÊý¾Ý£¬ÒòΪÏìÓ¦¼°httpÍ·²»È«£¬Õâʱͨ¹ýresponseBodyºÍresponseText»ñÈ¡²¿·ÖÊý¾Ý»á³öÏÖ´íÎó¡£
4 (Íê³É)-- Êý¾Ý½ÓÊÕÍê±Ï,´Ëʱ¿ÉÒÔͨ¹ýͨ¹ýresponseXmlºÍresponseText»ñÈ¡ÍêÕûµÄ»ØÓ¦Êý¾Ý
Ïà¹ØÎĵµ£º
Ç°ÑÔ
×î½ü³¢ÊÔÔÚGoogle App Engine£¨GAE£©Æ½Ì¨ÉϹ¹½¨Ò»¸öblog£¬Ä¿Ç°½ø¶ÈÒѾÍê³É½«½ü50%£¬ÆäÖÐCssºÍDIV²¼¾ÖÕÛÌÚµÃÎÒ¹»Çº£¬¶ÔUIÒ»ÏòÊǸöÍâÐУ¬É«¸ÐÄÃÄóʵÔÚûÆ×£¬Ö»ºÃ·ÂÔìWordpressÁË--_--||£»
ΪºÎ²ÉÓÃAJAX£º
»Ø¸´ÊÇÔÚblogÎÄÕÂÔĶÁÖеÄÒ»¸ö³£¼ûµÄ¹¦ÄÜ£¬ÈçCSDNµÄ»Ø¸´µÈµÈ£¬µ«ÊÇÒòΪ»Ø¸´ÄÚÈݲ»¶à£¬ÉõÖÁ´ó¶àÊýʱ¼äÓ ......
Ò»¡¢°×»°AjaxµÄÔÀí
Õâ¸öÆäʵҪ´ÓC/SºÍB/SµÄÔÀí˵Æð¡£Windows²Ù×÷ϵͳµÄµ®Éú£¬Îªµ¥»úͨÐÅÌṩÁ˺ܴóµÄÖ§³Ö£¬³ÌÐòÉè¼ÆÒ²´ÓDOSÔçÆڵĵ¥ÈÎÎñµ¥Óû§ÏòÍøÂçµÄ·Ö²¼Ê½Ó¦Óùý¶È¡£C/SÌṩµÄ¿Í»§/·þÎñÆ÷±à³ÌģʽΪÍøÂçÓ¦ÓÃÌṩÁËÒ»¸öÓÐЧµÄͨÐÅÊֶΡ£ä¯ÀÀÆ÷ÓëWeb·þÎñÆ÷Ö®¼äµÄÇëÇó/ ·þÎñ£¬¾ÍÊ ......
XMLHttpRequest ¶ÔÏóÊÇAJAX¹¦ÄܵĺËÐÄ£¬Òª¿ª·¢AJAX³ÌÐò±ØÐë´ÓÁ˽âXMLHttpRequest ¶ÔÏó¿ªÊ¼¡£
¡¡¡¡Á˽âXMLHttpRequest ¶ÔÏó¾ÍÏÈ´Ó´´½¨XMLHttpRequest ¶ÔÏó¿ªÊ¼£¬ÔÚ²»Í¬µÄä¯ÀÀÆ÷Öд´½¨XMLHttpRequest ¶ÔÏóʹÓò»Í¬µÄ·½·¨£º
¡¡¡¡ÏÈ¿´¿´IE´´½¨XMLHttpRequest ¶ÔÏóµÄ·½·¨(·½·¨1)£º
¡¡¡¡var xmlhttp = new ActiveXObject(" ......
ǰ̨£º
<html>
<head>
<title>AjaxʵÏÖÎÞË¢ÐÂÈýÁª¶¯ÏÂÀ¿ò</title>
<SCRIPT language="javascript">
......
var Ajax = new Object;
Ajax.Sysch = function(url) {
var req;
var result = "";
//document .write ("hello")
if (window.XMLHttpRequest) {
//´úÂë¶Î1
// ·ÇIEä¯ÀÀÆ÷
req = new XMLHttpRequest();
//alert(req);
//req.setReque ......