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

¶ÔAjaxµÄһЩ»ù±¾Àí½â

Ò»¡¢ajaxµÄÈëÃÅ
  1¡¢XMLHttpRequest¶ÔÏóµÄʹÓã¨Ê¹ÓÃXMLHttpRequest½âÎöxmlÎļþ£©
 onreadystatechange
Ö¸¶¨µ±readyStateÊôÐԸıäʱµÄʼþ´¦Àí¾ä±ú
 open()
´´½¨Ò»¸öеÄhttpÇëÇ󣬲¢Ö¸¶¨´ËÇëÇóµÄ·½·¨¡¢URLµÈÐÅÏ¢
 send()
·¢ËÍÇëÇóµ½http·þÎñÆ÷²¢½ÓÊÕ»ØÓ¦
 readyState
    ·µ»ØXMLHTTPÇëÇóµÄµ±Ç°×´Ì¬
 status
       ·µ»Øµ±Ç°ÇëÇóµÄhttp״̬Âë
 responseText
½«ÏìÓ¦ÐÅÏ¢×÷Ϊ×Ö·û´®·µ»Ø
 responseXML
½«ÏìÓ¦ÐÅÏ¢¸ñʽ»¯ÎªXml Document¶ÔÏó²¢·µ»Ø
out»ØÓ¦¿Í»§
£±¡¢“Ìí¼ÓÐÂÏî” Ð½¨Ò»¸öXMLÎļþÀ´´æ·ÅÒª±»µ÷ÓõÄÊý¾Ý¡£
XMLFile.xml
<?xml version="1.0" encoding="utf-8" ?>
<response>
    <res>
       ¶Ô²»Æð,µÇ¼ʧ°Ü!
    </res>
</response>
 
£²¡¢“Ìí¼ÓÐÂÏî” Ð½¨Ò»¸öJSPÒ³£¬Ìí¼Ó´úÂ룺
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>AjaxÒì²½µ÷ÓÃ</title>
</head>
<body>
    <div style="background-color:Yellow" id="mytext">AjaxÒì²½µ÷ÓÃ
</div>
    <input type="button" value="¸üÐÂ" onclick="startHTTP()" />
</body>
</html>
<script type="text/javascript">
var XMLHttpReq;
function createHTTP(){
   //¸ù¾Ý²»Í¬µÄä¯ÀÀÆ÷´´½¨XMLHttpRequest
   if(window.ActiveXObject)//ieä¯ÀÀÆ÷
     {
        XMLHttpReq=new ActiveXObject("Microsoft.XMLHTTP");
     }
   else  if(window.XMLHttpRequest){//ÆäËûä¯ÀÀÆ÷
        XMLHttpReq=new XMLHttpRequest();
   }
}


Ïà¹ØÎĵµ£º

µÚ¶þ²½£º·ºÐÍͨÓö¯Ì¬²éѯ(LinQ+Ajax)

ÎҵĴºÇï³ÕÃεڶþ²½£º
дһ¸ö ͨÓÃµÄ ¶ÔÏó ÁÐ±í £¬»¹ °üº¬ ËÑË÷ºÍ ÊôÐÔ¹ýÂË¡£
¾ßÌåµÄЧ¹ûÊÇ£º
µ±Ð ҵÎñ Ìí¼ÓÒ»¸ö ±íµÄʱºò£¬Ö»ÐèÒªÔÚ ¶ÔÏóÄ£ÐÍÀïµÄ Ìí¼ÓÒ»¸ö model
ºǫ́¼¸ºõ²»Ðèд´úÂë¡£
(ÎÒÊǺǫ́£º¼¤¶¯ÈËÐÄ£¡)
µ÷ÓõĶÔÏ󣬵ڼ¸Ò³£¬ÊôÐ﵀ ¹ýÂË ºÍËÑË÷È«ÊÇ Ç°Ì¨µÄAjax²ÎÊý¿ØÖÆ
(ÎÒÊÇǰ̨£º#$!@#$%$^#$% ......

ASP.NET,AJAXÎļþÉÏ´«µÄÒÉÎÊ¡£

ASP.NET,AJAXÎļþÉÏ´«µÄÒÉÎÊ
Ô­±¾ÒÔΪÓÃÕâÖÖ·½Ê½£¬°Ñ´Ë·½·¨·Åµ½Ò»¸öHttphandlerÖУ¬È»ºó´ÓJAVASCRIPT·ÃÎÊHttphandlerÀ´ÊµÏÖÎÞˢеÄÎļþÉÏ´«¡£Ã»Ïëµ½£¬ÕâÑùͬÑùÊDz»Ðеģ¬Ö»ÄÜÔÚ±¾»ú²âÊÔͨ¹ý£¬Èç¹û·Åµ½ÍøÉÏ£¬»òÕß´ÓÆäËûµØ·½·ÃÎʾͻáÌáʾÎÞ·¨ÕÒµ½Îļþ£¬¿É¼ûÔÚASP.NETÖÐËüÖ»ÄÜÓÃÓÚÉÏ´«·þÎñÆ÷¶ËµÄÎļþ¡£ 
֮ǰÔÚÍøÕ¾Ò²Ë ......

ajaxʵÏÖgoogle/baiduÊäÈëÌáʾ¿ò

var http_request;
    function find(txt) {
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
        http_request.onreadystatechange = function() {
        &n ......

ajax»º´æÎÊÌâ½â¾ö;¾¶

ÎÒÓÃPHPºÍAjax½áºÏ£¬Ìí¼ÓÊý¾ÝÖ®ºó£¬Ë¢ÐÂǰ̨ҳÃ棬Êý¾ÝûÓб仯¡£
ÎҸĶ¯PHP¶¯Ì¬½Å±¾£¬Ö»ÓÐÖØÐÂÕÒ¿ªIEÔÙÊäÈëµØÖ·£¬²ÅÄÜ¿´µ½Ð§¹û¡£
ÒÔÉÏÕâЩÊDz»ÊÇ»º´æµÄÔ­Òò°¡£¿Ôõô½â¾ö£¿
ajax»º´æÎÊÌâ½â¾ö;¾¶£º
ÊÇ»º´æµÄÎÊÌâ¡£
ÔÚ·þÎñ¶Ë¼Ó header("Cache-Control: no-cache, must-revalidate");
²¢ÇÒÔÚÄãµÄJSÌá½»²ÎÊýÖмÓËæ»ú» ......

Ajax½éÉÜ XMLHttpRequest

Ajax½éÉÜ
AJAX - ä¯ÀÀÆ÷Ö§³Ö
AJAX µÄÒªµãÊÇ XMLHttpRequest ¶ÔÏó¡£²»Í¬µÄä¯ÀÀÆ÷´´½¨ XMLHttpRequest ¶ÔÏóµÄ·½·¨ÊÇÓвîÒìµÄ¡£IE ä¯ÀÀÆ÷ʹÓà ActiveXObject£¬¶øÆäËûµÄä¯ÀÀÆ÷ʹÓÃÃûΪ XMLHttpRequest µÄ JavaScript ÄÚ½¨¶ÔÏó¡£ÈçÐèÕë¶Ô²»Í¬µÄä¯ÀÀÆ÷À´´´½¨´Ë¶ÔÏó£¬ÎÒÃÇҪʹÓÃÒ»Ìõ "try and catch" Óï¾ä¡£
<script type="t ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ