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()µÄ»°£¬»áµ¼ÖÂÎÞ·¨·¢ËͺóÃæµÄÊý¾Ý¡£
Ïà¹ØÎĵµ£º
jQuery Ajax È«½âÎö
±¾ÎĶÌÖ·£ºhttp://s8.hk/0itq
±¾ÎĵØÖ·: jQuery Ajax È«½âÎö
±¾ÎÄ×÷ÕߣºQLeelulu
תÔØÇë±êÃ÷³ö´¦£¡
jQueryȷʵÊÇÒ»¸öͦºÃµÄÇáÁ¿¼¶µÄJS¿ò¼Ü£¬ÄÜ°ïÖúÎÒÃÇ¿ìËٵĿª·¢JSÓ¦Ó㬲¢ÔÚÒ»¶¨³Ì¶ÈÉϸıäÁËÎÒÃÇдJavaScript´úÂëµÄÏ°¹ß¡£
·Ï»°ÉÙ˵£¬Ö±½Ó½øÈëÕýÌ⣬ÎÒÃÇÏÈÀ´¿´Ò»Ð©¼òµ¥µÄ·½·¨£¬ÕâЩ·½·¨¶¼ÊǶÔjQu ......
1´´½¨Á½ÕÅÒ³Ãæ Reg.aspx¡¢CallServer.aspx¡£
ÔÚReg.aspxÒ³ÃæµÄhtmlÖзŠһ¸ö²ãºÍÒ»¸öÎı¾¿ò
<div id="aa">
<asp:TextBox id="txtuser" runat="server" Width="136px"></asp:TextBox>
</div>
<span id="errInfo">ÇëÊäÈëÓû§Ãû</span>
ÔÚReg.aspxÒ³ÃæÖÐдjavascript
¶¨Òå¶þ¸ö±äÁ¿ ......
×î½ümatch001.comÏîÄ¿×öÒ»¸ö·¢Ë͵ç×ÓϲÌûµÄ¹¦ÄÜ£¬·¢ÏÖQQÓÍÏäÃ÷ÐÅƬ¹¦Äܲ¶à¡£ÓÚÊǺõ¹¹Ë¼×ö³ÉÄǸöÑù×Ó¡£
Óм¸µãÐèҪʵÏֵģº
±³¾°Í¼Æ¬¡¢½á»éÏàƬµÄ¼ÓÔØ¡£
N¶àµÄʼþ°ó¶¨
¸úÏà²áÊý¾Ý°ó¶¨£¬Ñ¡ÔñÏà²áÁгöËùÓÐÏàƬ£¬²¢ÇÒÏàƬ·ÖÒ³¡£ËùÓеĶ¼AJAXʵÏÖ
³õʼ»¯Ò»¸öDIVÓÃÀ´¿ØÖÆÉϲãͼƬλÖÃÒƶ¯£¬¸ù¾Ý²»Í¬±³¾°Í¼Æ¬£¬³õʼ»¯²»²» ......
oad()·½·¨
load( url [,data] [,callback]) dataÊÇObjectÀàÐÍ£¬·¢ËÍÖÁ·þÎñÆ÷µÄkey/valueÊý¾Ý
Àý£º
$(function(){
$("#send").click(function(){
$("#resText").load("test.html ......
MOOTOOLSÖеķ½·¨Ê¹ÓÃ
Core.js
º¯Êý: $extend ½«µÚ¶þ¸ö²ÎÊý¶ÔÏóµÄËùÓÐÊôÐÔ¸´ÖƵ½µÚÒ»¸ö²ÎÊý¶ÔÏóÖÐ.
º¯Êý: $merge ºÏ²¢Ò»×é¶ÔÏóÉú³ÉжÔÏó
º¯Êý: $each µü´úÊý×é(°üÀ¨·Ç³£¹æÊý×é,ÈçÓÉÄÚ½¨µÄgetElementsByTagName·½·¨·µ»ØµÄ¼¯ºÏ¶ÔÏó, arguments¶ÔÏó, »òOjbect¶ÔÏó)
º¯Êý: $pick ·µ»Ø² ......