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

AJAXʵʱ¶ÁÈ¡ÊäÈëÎı¾

 ¿Í»§¶ËString.php,·þÎñÆ÷¶ËString_check.php£¬ºÜ¼òµ¥µÄʵÏÖ¡£
¿Í»§¶Ë´úÂ룺
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ÎÞ±êÌâÎĵµ</title>
</head>
<script language="javascript">
var xmlHttp;
function createXMLHttpRequest(){
 if(window.ActiveXObject){
  xmlHttp = new ActiveXObject("microsoft.XMLHTTP");
 }
 else if(window.XMLHttpRequest){
  xmlHttp = new XMLHttpRequest();
 }
}
function sendRequest(){
 
 createXMLHttpRequest();
 
 var name = document.getElementById("name").value;
 url = "String_check.php?page="+name;
 xmlHttp.onreadystatechange = callback;
 xmlHttp.open('GET',url,true); 
 xmlHttp.send(null);
}
function callback(){
 if(xmlHttp.readyState == 4){
  if(xmlHttp.status == 200){
   document.getElementById("show").innerHTML = "ÄúÊäÈëµÄ×Ö·û´®Îª£º"+ xmlHttp.responseText;
   
  }
 }
}
</script>
<body>
<p>AJAX test;</p>
<p><br/>
  <input type="text" id="name" onkeyup="sendRequest();" />
  <br/>
  <span id="show"></span>
</p>
</body>
</html>
·þÎñÆ÷¶Ë´úÂ룺
<?php
header('Content-type: text/html;charset=GB2312');
$ename = $_GET["page"];
if ($ename == "") {
 $ename = "ÇëÊäÈ룺";
}
echo ($ename);
exit(0);
?>


Ïà¹ØÎĵµ£º

ASP.NET Óë AJAXµÄʵÏÖ·½Ê½

µ½Èí¼þ¹«Ë¾Ñ§IT¼¼Êõhttp://www.tsp2c.cn/
Ajax Ó¦¸Ã²»ÊÇÒ»Ïî¼¼Êõ£¬ÊÇÒ»ÖÖ˼Ïë¶øÒÑ£¬¸ú ASP.NET ÒÔ¼°ÆäËü Web ¿ª·¢ÓïÑÔûÓÐʲô̫´ó¹ØÏµ£¬ÕâÀïÖ»ÊÇ̸̸ ASP.NET ÖÐĿǰʹÓÃµÄ Ajax ¼¼ÊõÒÔ¼°ÆäËüһЩʵÏÖ Ajax µÄÓÅÐã¿ò¼Ü¡£
¡¡¡¡Ajax ÒѾ­ºÜÁ÷ÐÐÒ»Õó×ÓÁË£¬ÏÖÔÚ̸ Ajax ¾õµÃÓеãÀÏÍÁ¡£Ä¿Ç°ËùνµÄ Web2.0 ÍøÕ¾£¬»ù±¾ÉÏûÓв» ......

VS2005ÖÐajax°²×°Ö¸ÄÏ

 web2.0ºá¿Õ³öÊÀ£¬ajaxÊ×µ±Æä³å£¬½ñÌì×öwebµÄÈç¹ûÔÙ²»Ñ§µãajaxµÄ»°£¬¾ÍÏÔµÄÂäÎéÁË£¬¶øÑ§ajaxµÄÓõĻ·¾³Èç¹ûÊÇasp.net£¬ÄÇajax.netÄã¾Í²»µÃ²»Ñ§ÁË¡£Ê×ÏȾÍÊÇ»·¾³µÄÅäÖã¬ÈçÏÂ
vs2005+sql2005+Winxp sp2+ie6.0+Office2003
¹¤¾ßÏÂÔØ 
1.ASPAJAXExtSetup.msi
http://download.microsoft.com/download/5/4/6/5462 ......

AjaxµÄºËÐĶÔÏóXMLHttpRequest

   XMLHttpRequestÊÇXMLHTTP×é¼þµÄ¶ÔÏó£¬Í¨¹ýÕâ¸ö¶ÔÏó£¬Ajax¿ÉÒÔÏñ×ÀÃæÓ¦ÓóÌÐòÒ»Ñùֻͬ·þÎñÆ÷½øÐÐÊý¾Ý²ãµÄÐÅÏ¢½»»»£¬¶ø²»ÓÃÿ´Î¶¼Ë¢ÐÂÒ³Ãæ£¬Ò²²»ÓÃÿ´Î½«Êý¾Ý´¦ÀíµÄ¹¤×÷¶¼½»¸ø·þÎñÆ÷À´×ö£»ÕâÑù¼´¼õÇáÁË·þÎñÆ÷µÄ¸ºµ£ÓÖ¼Ó¿ìÁËÏìÓ¦ËÙ¶È¡¢Ëõ¶ÌÁËÓû§µÈ´ýµÄʱ¼ä¡£
    XMLHttpRequestÊÇAjax¼¼ÊõÖÐ×î ......

AjaxÖÐsend²ÎÊý

 Ò»°ãÇé¿öÏ£¬Ê¹ÓÃAjaxÌá½»µÄ²ÎÊý¶àÊÇЩ¼òµ¥µÄ×Ö·û´®£¬¿ÉÒÔÖ±½ÓʹÓÃGET·½·¨½«ÒªÌá½»µÄ²ÎÊýдµ½open·½·¨µÄurl²ÎÊýÖУ¬´Ëʱsend·½·¨µÄ²ÎÊýΪnull¡£
       ÀýÈç £º
                   ......

ѧϰAjax½Ì³Ì£¬ÏêϸÁ˽âGetÓëPost

ѧϰAjax½Ì³Ì£¬ÏêϸÁ˽âGetÓëPost
Get·½Ê½:
×÷ÓÃ:¿É´«Ëͼòµ¥Êý¾Ý
´óС:url×î´ó³¤¶ÈÊÇ2083 bytes,¿ÉÒÔÓÃÓÚGET´«µÝÊý¾ÝµÄ³¤¶ÈÊÇ2048 bytes
°üº¬Ìå:Êý¾Ý×·¼Óµ½urlÖз¢ËÍ,Ò²¾ÍÊÇhttpµÄheader´«ËÍ
Post·½Ê½:
×÷ÓÃ:¿É´«Ëͼòµ¥¸´ÔÓÊý¾Ý
´óС:web.configÀïÏÞÖÆ
°üº¬Ìå:Êý¾ÝÔÚhttpÇëÇóµÄʵÌåÄÚÈÝÀï´«ËÍ
AjaxÓÃPostģʽ´«ËÍÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ