ajax³õ²½´î½¨¼°Ê¾Àý´úÂë
AJAX(Asynchronous JavaScript and XML):»ùÓÚXMLµÄÒì²½JavaScript£¬¼ò³ÆAJAX,ÊǶàÖÖ¼¼ÊõµÄ×ÛºÏ.
Ò»ÖÖ¿Í»§¶Ë¼¼Êõ ,Ϊ»¥ÁªÍøÓû§Ìṩ¸ü¼ÓÓÑÉÆµÄ½»»¥½çÃæ,¸ü¼ÓÁ÷³©µÄÓû§ÌåÑé.Ò²¾ÍÊÇËùνµÄÅÖ¿Í»§¶Ë,Ê¹ÍøÒ³µÄЧ¹ûÄܹ»Ïñ°²×°ÔÚ¼ÆËã»úÉϵÄÓ¦ÓÃÈí¼þ»òϵͳһÑùÓѺûªÀö.
ËüÓÉÈçÏÂËÄÖÖ¼¼Êõ×é³É:CSS + DOM + XMLHttpRequest+ JavaScript .
¸÷²¿·Ö¹¦ÄÜÈçÏÂ:
CSS : ¿ØÖÆÒ³ÃæµÄÏÔʾ ¡£
DOM : ¿ØÖÆÎĵµ½á¹¹ ¡£
XMLHttpRequest: ¸ºÔðÓë·þÎñÆ÷½øÐÐÒ첽ͨÐÅ ¡£
JAVAScript : µ÷Ó㬿ØÖÆÆäËûÈý¸ö×é³É²¿·Ö¡£
Èç¹ûÈ¥µôXMLHttpRequestÔòΪDHTML¼¼Êõ.
==========================================================
»ù±¾Á÷³ÌÈçÏÂ:
1) ʼþ´¥·¢Í¨ÐŹý³Ì
2)
2.1 ´´½¨XMLHttpRequest¶ÔÏó createXHR()
2.2 ×¼±¸Òª·¢Ë͵½·þÎñÆ÷µÄ²ÎÊý .
2.3 Ö¸¶¨ÓÃÓÚ´¦ÀíÓ¦´ðµÄº¯Êý . xhr.onreadystatechange = fn [ »Øµ÷º¯Êý ] ;
2.4 open() , send() ;
3) ±àд»Øµ÷º¯Êý .
3.1
ͨÐŹý³Ì½áÊø £º xhr.readyState == 4
·þÎñÆ÷Ö´ÐÐ £º xhr.status == 200
3.2 ¶Ô·þÎñÆ÷µÄÓ¦´ð½á¹û½øÐд¦Àí :
¸´ÔÓµÄÓÃxhr.responseXML (DOM·½Ê½)
¼òµ¥µÄÓÃxhr.responseText(·µ»ØµÄ×Ö·û´®)
==========================================================
XMLHttpRequestÓë·þÎñÆ÷Ö®¼äÊý¾Ý½»»»µÄ·½Ê½ÓÐgetºÍpostÁ½ÖÖ.
ʹÓÃPOST·½Ê½Ìá½»:
url = "/ajax/test.jsp" ;
XMLHttpRequest.open( "POST" , url );
 
Ïà¹ØÎĵµ£º
¼òµ¥µÄÃèÊöÏ DWR ÅäÖ㨱£ÃÜÐÒ飬Ôڴ˲»¹«¿ªÏîÄ¿Ãû³Æ£¬ÏîÄ¿Ïà¹ØÃû³ÆÈ«²¿ÓÃXXXX´úÌæ£©
Ê×ÏÈ ·Ï»°²»ËµÁË ´ó¼Ò¶¼Ó¦¸ÃÀí½âDWRµÄÓô¦ ²»¶®µÄÈ¥°Ù¶È
±ØÒª°ü DWR.JAR ¹Ù·½ÏÂÔØµØÖ·http://directwebremoting.org/dwr/download.html
Õâ¸öÏîÄ¿ÊÇÓÉ SSH+dwr+jquery+sitemesh+freemarker
WEB.XML
<!-- dwr -->
<serv ......
AjaxSuggest.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxSuggest.aspx.cs" Inherits="AjaxSuggest" %>
<!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/199 ......
VS2005ÖÐajax°²×°Ö¸ÄÏ
ÒÔÏÂÊÇÊÕ¼¯¹ØÓÚAjaxControlToolkit°²×°µÄһƪÎÄÕ£¬¸ÐлÔ×÷Õß
AjaxControlToolkitÏÂÔØhttp://ajax.asp.net/downloads/default.aspx?tabid=47
http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx?ReleaseId=1425
»·¾³ÉèÖÃÈçÏ£º
ÏÂÔØÍê
ASPAJAXExtSetup.msi ° ......
Ò»¡¢Ç°ÑÔ
´ò¿ª¹¤¾ßÏäµÄAjax extensions¿ÉÒÔ¿´µ½Îå¸öajax¿Ø¼þ£¬ÔÚvs2008ÖÐËüÃÇÒѾ¼¯³Éµ½ÁË.net framerwork3.5ÖУ¬Èç¹ûÊÇ֮ǰ°æ±¾µÄvsÔòÐèÒª×Ô¼ºÈ¥ÏÂÔØÎļþÀ´°²×°¡£ÕâÎå¸ö¿Ø¼þÔÚajaxÖÐÊǷdz£³£Óõģ¬ËùÒÔ΢Èí²Å½«ËûÃǼ¯³Éµ½vsÖÐÀ´£¬ÏÂÃæ½«¼òµ¥µÄ½éÉÜ×ÅÎå¸ö¿Ø¼þ¼°ËüÃǵÄÖØÒªÊôÐÔ¡£
¶þ¡¢ÖØÖÐÖ®ÖØ——Scrip ......
ÒÔǰ×öÁËЩajax£¬ÊÇÔÚ.net2.0¼ÓÉÏajax toolkit¿ª·¢µÄ¡£ÏÖÔÚÒª×÷Ϊһ¸öÏÖÓÐÍøÕ¾µÄ×ÓÕ¾µã¡£Ä¿Ç°µÄ3.5ϵͳ×Ô´ø3.5°æ±¾µÄajax£¬Ò²¾ÍÊÇSystem.Web.Extensions 3.5¡£Õâ¸öÔÚajax toolkit 1.0ÖÐÒ²ÊÇͬÑùµÄassemblyÃû×Ö£¬ÒÔÖÁweb.configÎļþ»á±¨´í£¬ËµÕÒµ½2¸öͬÑùµÄassembly¡£ÓÖ²»¿ÉÄÜÈ¥ÐÞ¸ÄÀÏÕ¾ÀïÃæµÄÎļþ£¬Ôõô°ìÄØ£¿ÎÒÃǼÈÏ£Íû±£Á ......