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

AjaxÌá½»±íµ¥ òËÆÖ»ÄÜÓÃpost

     ÒÔÇ°Ìá½»±íµ¥µÄ·½·¨ÊÇsubmit£¬µ«ÊÇÕâÑùµÄ»°ÎÞ·¨Ê¹ÓÃAjax£¬Ò»Ìá½»¾ÍÒâζ×ÅÐèҪˢÐÂÒ³Ãæ¡£ÁíÒ»ÖÖ·½·¨ÊÇÔÚurlÉÏÃæ¼ÓÉÏparameterÀ´·¢ËÍ±íµ¥£¬µ«ÊÇÕâÑù»á±©Â¶·¢Ë͵ÄÄÚÈÝ¡£µ«ÊÇÈç¹ûÓÃAjax·¢ËÍ±íµ¥µÄ»°¾ÍÄܱÜÃâÉÏÃæÁ½ÖÖÎÊÌâ¡£
     µ«ÊÇÎÒ֮ǰ×Ô¼ºÐ´µÄʱºò£¬×ÜÊÇÌá½»µÄÊÇnullÖµ£¬ÔËÐÐҲûÓÐÒì³£¡£ºóÀ´·¢ÏÖ±ØÐëÒª±ä³É“post”²ÅÄÜÖ´Ðгɹ¦¡£ÏÂÃæÌù³öÌá½»±íµ¥²¿·ÖµÄAjax´úÂ룺
createXMLHttp();
xmlHttp.open("post", "/project/action.do?method=actionMethod&"+ Math.round(Math.random() * 100), true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.onreadystatechange = handleActionMethod;
xmlHttp.send("name=" + name + "&detail=" + detail);
Èç¹ûÔÚopenµÄºóÃæûÓÐsetRequestHeader()µÄ»°£¬»áµ¼ÖÂÎÞ·¨·¢ËͺóÃæµÄÊý¾Ý¡£


Ïà¹ØÎĵµ£º

ajax json,xml,Îı¾Êý¾Ý´«µÝʵÀý

µ½×îºóÎҲŷ¢ÏÖ΢Èí¸øµÄajax json ʵÀý¶¼ÊÇÓÐÎÊÌâµÄ£¬ºÜ¶à¶¼ÊDz»ÑÏÃܵģ¬ÌرðÊǶÔÓÚ´óСд·½Ã棬ËûÃǶ¼Ã»ÓÐ×Ðϸ׷¾¿´óСдÎÊÌ⣬µ¼ÖÂÁËÔÚfirefoxʹÓÃÓÐÎÊÌâ¡£ÏÂÃæÊÇʵÀýÄÚÓãºÁ½¸öhtmlÖ®¼äµÄ£º
<head> <title>²âÊÔajax</title> <meta http-equiv=”Content-Type” content=”text/ht ......

µÚÒ»¸öAjax ʵÀý

<!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>¼òµ¥µÄÓ¦ÓÃXMLHt ......

AjaxÎÞ·¨³¹µ×ɾ³ýSessionµÄÊôÐÔ

     ×î½üÔÚÓÃAjax×öµÇ¼´°¿Ú£¬µ«ÊÇlogoutµÄʱºòÐèÒª¶Ôsession½øÐд¦Àí¡£ÓõÄÊÇsession.removeAttribute()º¯Êý½øÐÐlogout¡£µ«ÊÇ£¬ÊÂʵ֤Ã÷£¬ÔÚlogoutÒÔºó£¬ÔٴεǼµÄʱºò£¬²¢²»Äܵǽ³É¹¦£¬Ñ¹¸ù²»»á½øÈëactionÖ´ÐÐÏàÓ¦µÄ·½·¨£¨hqlÓï¾äҲûÓÐÖ´ÐУ©¡£
     Ϊ´Ë£¬¾Ý˵ÓÐÁ½ÖÖ·½·¨½ ......

jQueryÓëasp.net ajaxÎÄÕÂÁ½Æª

1.Using jQuery with ASP
.NET
http://dotnetslackers.com/articles/ajax/using-jquery-with-asp-net.aspx
°üÀ¨jQueryÔõôµ÷ÓÃasp.net web service
2.jQuery and ASP.NET AJAX
UpdatePanel
http://www.dotnetfunda.com/articles/article471-jquery-and-aspnet-ajax-updatepanel.aspx
²¿·Ö¸üкóÔõô±£³ÖjQueryÓ¦Ó ......

Rails ajax µÄÁª¶¯µÄÏÂÀ­¿ò


# app\controllers\examples_controller.rb
ruby ´úÂë
 
class ExamplesController < ApplicationController  
  
  def ajax_select  
    @items = %w{AA BB}  
  end   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ