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

ajaxѧϰ¼

ÓйØajaxµÄÆäʵ¾ÍÊÇ1¸öÀàµÄʹÓÃ:XMLHttpRequest.
Ê×ÏÈÒªÉùÃ÷Õâ¸öÀàµÄ¶ÔÏ󣬼øÓÚ¸÷¸öä¯ÀÀÆ÷°ÑÕâ¸öÀàǶÈëµÄ·½Ê½²»Í¬£¬ÉùÃ÷µÄ·½Ê½Ò²²»Í¬£º
  var xmlHttpReq = null;
if (window.XMLHttpRequest) //Mozilla ä¯ÀÀÆ÷
{
¡¡¡¡¡¡ xmlHttpReq = new XMLHttpRequest();
¡¡¡¡}
¡¡ else if (window.ActiveXObject) // IEä¯ÀÀÆ÷
{
try
{
xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("ÄúµÄä¯ÀÀÆ÷²»Ö§³ÖAJAX£¡") ;
}
} ¡¡¡¡
¡¡ }
else
{
alert("ÄúµÄä¯ÀÀÆ÷²»Ö§³ÖAJAX£¡") ;
}
È»ºóÊÇopen£¬send£¬getresponse
 xmlHttpReq.open("POST","http://localhost///6gold/home_validate.php",true);
xmlHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttpReq.onreadystatechange = function()
{
if (xmlHttpReq.readyState == 4)
{
if (xmlHttpReq.status == 200)
{
document.getElementById('span_' + key).innerHTML = xmlHttpReq.responseText;
}
}
}
xmlHttpReq.send("personid=<?php echo($_SESSION['uid']); ?>" + "&key=" + key + "&value=" + value);
ÕâÀïÓõÄÊÇPOST·½·¨£¬ÈôÓÃGET£¬×îºóÒ»¾äsend¿ÉÒÔ¸ÄΪ
xmlHttp.send(null);
»òÕß
xmlHttp.send("");
×¢Ò⣺
xmlHttpReq.onreadystatechangeʼþ  ҪдÔÚ xmlHttpReq.send()ʼþ֮ǰ¡£ÒòΪÈç¹ûÏÈsend£¬ÔÙ²¶×½onreadystatechangeµÄ»°£¬send¿ìµÄ»°£¬readystateÒѾ­±äΪ4£¨³É¹¦·µ»Ø£©ºó²Å¿ªÊ¼²¶×½readystatechangeʼþ£¬»á²¶×½²»µ½¡£
xmlHttpReq.responseTextµÄÄÚÈÝËƺõÊÇ·þÎñ¶ËÒ³ÃæµÄ<body></body>¼äµÄÄÚÈÝ£¬²»ÊǺÜÈ·¶¨¡£
get·½Ê½´«ÖÐÎÄËƺõ»á³ö±¨´í£¬¸ÄÓÃpost´«ÖÐÎÄ£¬¿Í»§¶Ë->·þÎñ¶Ë,ûÓÐÎÊÌ⣻·þÎñ¶Ë->Êý¾Ý¿â(sql server2005)->¿Í»§¶Ë£¬¾Í»á³öÏÖÂÒÂ룬²»ÖªµÀÄÄÀïÓÐÎÊÌ⣬ÎÒÊÇÔÚ·þÎñ¶Ëת»»ÁËϱàÂë¸ã¶¨µÄ£ºecho mb_convert_encoding($msg,"utf-8","gb2312");


Ïà¹ØÎĵµ£º

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

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

AJAXС½á

Ô­³ö´¦:http://blog.163.com/zwx_gis/blog/static/32434435200971072634757/
Web±à³ÌÏà¹Ø   2009-08-10 19:26   ÔĶÁ15   ÆÀÂÛ0  
 
Ajax (Asynchronous JavaScript and XML) ÊǶàÖÖ¼¼ÊõµÄ¼¯ºÏ£¬°üÀ¨JavaScript¡¢XHTML¡¢CSS¡¢DOM¡¢XML¡¢XSTL¡¢XMLHttpRequestµÈ£¬ÆäÖÐXHTM ......

Ó¦ÓÃASP.NET AJAXµÄ×¢ÒâÊÂÏî

 1. ¾µÍ·Ç¨áãÓ¦µ±Ó¦ÓÃʵʩ¾µÍ·Öض¨ÏòµÄResponse.Redirect¶ø²»ÊÇServer.Transfer£¬ÓÉÓÚServer.Transfer²»¸Ä±äIE¿Í»§¶ËURL£¬ÄÜÒÔÖÂASP.NET AJAX¿Í»§¶Ë½Å±¾·ÃÎÊ×ÊÔ´µÄʱ·Ö³öÏÖURL´í´¦¡£
¶þ.ÔÚ·þÎñÆ÷¶ËµÇ¼Ç½Å±¾ºÍÑÚ²Ø×Ö¶ÎÓ¦µ±Ê©ÓÃÖÖScriptManager£¬¶ø²»ÊÇPage.ClientScript¶ÔÏó£¬ÓÉÓÚPage.ClientScriptµÄ²½ÖèÊǽ«½Å±¾µÇ¼Ç ......

ÈçºÎʹÓÃajax¿ª·¢webÓ¦ÓóÌÐò£¨1£©

1.  http://hi.baidu.com/lshun/blog/item/2378b4c36fdef455b219a85b.html
CODE:
<?xml version="1.0" encoding="UTF-8"?>
<data>
   <pets>
     <è />
     <¹· />
     < ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ