jquery AJAXÓ¦ÓÃ
load(url[,data][,callback])------------->ͨ³£ÓÃÀ´´ÓWEB·þÎñÆ÷ÉÏ»ñÈ¡¾²Ì¬µÄÊý¾ÝÎļþ
url: stringÀàÐÍ ÇëÇóHTMLÒ³ÃæµÄURLµØÖ·
data(¿ÉÑ¡): object ·¢ËÍÖÁ·þÎñÆ÷µÄkey/valueÊý¾Ý
callback(¿ÉÑ¡):function ÇëÇóÍê³Éʱ»Øµ÷º¯Êý
Àý×Ó£º
Ö÷Ò³Ãæ´úÂ룺
<style type="text/css">
* { margin:0; padding:0;}
body { font-size:12px;}
.comment { margin-top:10px; padding:10px; border:1px solid #ccc;background:#DDD;}
.comment h6 { font-weight:700; font-size:14px;}
.para { margin-top:5px; text-indent:2em;background:#DDD;}
</style>
$(function(){
$("#send").click(function(){
$("#resText").load("test.html .para",function (responseText, textStatus, //test.html .paraΪtest.htmlÖÐ.classΪparaµÄÄÚÈÝXMLHttpRequest){
alert( $(this).html() ); //ÔÚÕâÀïthisÖ¸ÏòµÄÊǵ±Ç°µÄDOM¶ÔÏ󣬼´ $("#iptText")[0]
alert(responseText); //ÇëÇ󷵻صÄÄÚÈÝ
alert(textStatus); //ÇëÇó״̬£ºsuccess£¬error
alert(XMLHttpRequest); //XMLHttpRequest¶ÔÏó
});
})
})
<input type="button" id="send" value="Ajax»ñÈ¡" />
<div class="comment">
ÒÑÓÐÆÀÂÛ£º
</div>
<div id="resText" >
Ïà¹ØÎĵµ£º
http://www.longboo.com/
·ÖÒ³
http://www.longboo.com/Samples/linb/widgets/TreeGrid.Paging/index.html
Êý¾Ý¿â²éѯ¹¤¾ß
http://www.longboo.com/Samples/comb/OrderManagement/index.html
email¹¤¾ß
http://www.longboo.com/Samples/comb/OutLook/index.html
Íøµê
http://www.longboo.com/Samples/linb/Template ......
Ò»¡¢°×»°AjaxµÄÔÀí
Õâ¸öÆäʵҪ´ÓC/SºÍB/SµÄÔÀí˵Æð¡£Windows²Ù×÷ϵͳµÄµ®Éú£¬Îªµ¥»úͨÐÅÌṩÁ˺ܴóµÄÖ§³Ö£¬³ÌÐòÉè¼ÆÒ²´ÓDOSÔçÆÚµÄµ¥ÈÎÎñµ¥Óû§ÏòÍøÂçµÄ·Ö²¼Ê½Ó¦Óùý¶È¡£C/SÌṩµÄ¿Í»§/·þÎñÆ÷±à³ÌÄ£Ê½ÎªÍøÂçÓ¦ÓÃÌṩÁËÒ»¸öÓÐЧµÄͨÐÅÊֶΡ£ä¯ÀÀÆ÷ÓëWeb·þÎñÆ÷Ö®¼äµÄÇëÇó/ ·þÎñ£¬¾ÍÊ ......
ËÄ¡¢³£¼ûAjax±à³Ì¿ò¼Ü
¼ÈÈ»ÉÏÊöAjax¿ò¼ÜÒѾÄܹ¤×÷ÁË£¬ÎªÊ²Ã´»¹ÓÐÄÇô¶àµÄ¿ò¼ÜÄØ£¿
Ëæ×ÅÒ³ÃæµÄ¸´ÔÓ£¬¿ÉÄÜÐèÒªÊéд´óÁ¿µÄJavascript½Å±¾À´¶ÔÒ³ÃæÖеÄDOM¶ÔÏó½øÐпØÖÆ£¬¹¤×÷Á¿ºÍ¸´ÔÓ¶È»á´ó´óÔö¼Ó¡£Ajax±à³Ì¿ò¼Üͨ³£ÀûÓÃÃæÏò¶ÔÏóµÄ·½·¨£¬¶ÔһЩ»ù±¾µÄ¶ÔÏóºÍÐÐΪ¼° ......
AjaxµÄÈ«³ÆÊÇ£ºAsynchronousJavaScript+XML
2.AjaxµÄ¶¨Ò壺
Ajax²»ÊÇÒ»¸ö¼¼Êõ£¬Ëüʵ¼ÊÉÏÊǼ¸ÖÖ¼¼Êõ£¬Ã¿ÖÖ¼¼Êõ¶¼ÓÐÆä¶ÀÌØÕâ´¦£¬ºÏÔÚÒ»Æð¾Í³ÉÁËÒ»¸ö¹¦ÄÜÇ¿´óµÄм¼Êõ¡£
3.Ajax°üÀ¨£º
XHTMLºÍCSS
ʹÓÃÎĵµ¶ÔÏóÄ£ÐÍ(DocumentObjectModel)×÷¶¯Ì¬ÏÔʾºÍ½»»¥
ʹÓÃXMLºÍXSLT×öÊý¾Ý½»»¥ºÍ²Ù×÷
ʹÓÃXMLHttpRequest½øÐÐÒ ......
XMLHttpRequest ¶ÔÏóʹ AJAX ³ÉΪ¿ÉÄÜ¡£
XMLHttpRequest
XMLHttpRequest ¶ÔÏóÊÇ AJAX µÄ¹Ø¼ü¡£
¸Ã¶ÔÏóÔÚ Internet Explorer 5.5 Óë 2000 Äê 7 Ô·¢²¼Ö®ºó¾ÍÒѾ¿ÉÓÃÁË£¬µ«ÊÇÔÚ 2005 ÈËÃÇ¿ªÊ¼ÌÖÂÛ AJAX ºÍ Web 2.0 ֮ǰ£¬Õâ¸ö¶ÔÏó²¢Ã»Óеõ½³ä·ÖµÄÈÏʶ¡£
´´½¨ XMLHttpRequest ¶ÔÏó
²»Í¬µÄä¯ÀÀÆ÷ʹÓò»Í¬µÄ·½·¨À´´´½¨ ......