Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : ajax

jquery ajax ÖÐÎÄÂÒÂë


½áÂÛ£º
jquery 1.3.2 ajax¶Ô±àÂëÎÊÌâ½øÐйý²¿·Ö(¼ûºóÃæ²¹³ä1 )´¦Àí£¬½â¾ö·½°¸ÒÔjspΪÀý×Ó£º 
ajaxÌá½»Êý¾Ý¸øjsp£ºajaxËùÔÚÒ³ÃæÎÞÈκÎÒªÇó£¬jspÒ³ÃæÐè×÷Á½·½Ãæ´¦Àí¡£ 
1.<%@page contentType="application/json" pageEncoding="UTF-8"%>»ò<%@page contentType="application/json" pageEncoding="gb2312"%> 
2.´¦Àírequest.setCharacterEncoding("UTF-8")
Ïêϸ˵Ã÷£º
Ö®ËùÒÔ»áÂÒÂ룬ԭÒòºÜ¼òµ¥£¬Á½¸öÈ˶Ի°µÄʱºò£¬a˵ÖÐÎÄ£¬bÓÃÓ¢ÎĽÓÊÜ£¬ÓÚÊǺõÂÒÂëÒÓ£¡ ËùÒÔµ±³öÏÖÂÒÂë¸ãÇå³þË­ÊÇaË­ÊÇbºÜÖØÒª£¬È»ºóa˵»°µÄʱºòÈÃbÖªµÀÓ¦¸ÃÓÃʲôÓïÑÔ½ÓÊÕ£¬»òÕßbÒԹ̶¨µÄ·½Ê½½ÓÊÕ£¬aÓÃb½ÓÊÕµÄÓïÑÔȥ˵£¬ÕâÑù¾ÍÍòÊÂokÁË¡£ ËùÒÔÏÂÃæ·Ö³ÉÁ½²¿·ÖÈ¥·ÖÎö¡£Ò»¸öÊÇajaxµ¥´¿»ñÈ¡ÍøÒ³ÐÅÏ¢µÄÇé¿ö£¬Ò»¸öÊÇajaxµ¥´¿ÍùjspµÈÌá½»Êý¾ÝµÄÇé¿ö£¬Ï¸µÄÀ´Ëµ£¬ÕâÀïÖÖÇé¿öÓзÖÁ½ÖÖÇé¿ö¼´postºÍget
ajaxµ¥´¿×¥È¡ÍøÒ³
a£ºÇëÇóµÄÒ³Ã棬b£ºjquery ajax 
ÕâÀïΪʲôaÊÇÇëÇóµÄÒ³Ã棬¶øbÊÇjquery ajaxÄØ£¿ËäÈ»ÊÇajaxÏòÒ³ÃæÒª¶«Î÷£¬ µ«ÊÇÒ²¿ÉÒÔÀí½âΪa(Ò³Ãæ)Òª¸æËßajaxµÄÄÚÈÝÊÇʲô£¬ÓÚÊǺõa˵£¬ÎÒ¸æËßÄãb(jquery ajax)£¬ÎÒµÄÄÚÈÝÊÇ......²¢ÇÒÄÚÈݵÄÓïÑÔÊÇgb2312µÄ£¬ÄãÀ´½ÓÊÜ° ......

jQueryÖеÄAjax¼¸ÖÖÇëÇó·½·¨


jQueryȷʵÊÇÒ»¸öͦºÃµÄÇáÁ¿¼¶µÄJS¿ò¼Ü£¬ÄÜ°ïÖúÎÒÃÇ¿ìËٵĿª·¢JSÓ¦Ó㬲¢ÔÚÒ»¶¨³Ì¶ÈÉϸıäÁËÎÒÃÇдJavaScript´úÂëµÄÏ°¹ß¡£
·Ï»°ÉÙ˵£¬Ö±½Ó½øÈëÕýÌ⣬ÎÒÃÇÏÈÀ´¿´Ò»Ð©¼òµ¥µÄ·½·¨£¬ÕâЩ·½·¨¶¼ÊǶÔjQuery.ajax()½øÐзâ×°ÒÔ·½±ãÎÒÃÇʹÓõķ½·¨£¬µ±È»£¬Èç¹ûÒª´¦Àí¸´ÔÓµÄÂß¼­£¬»¹ÊÇÐèÒªÓõ½jQuery.ajax()µÄ(Õâ¸öºóÃæ»á˵µ½).
1. load( url, [data], [callback] ) £ºÔØÈëÔ¶³Ì HTML Îļþ´úÂë²¢²åÈëÖÁ DOM ÖС£
url (String) : ÇëÇóµÄHTMLÒ³µÄURLµØÖ·¡£
data (Map) : (¿ÉÑ¡²ÎÊý) ·¢ËÍÖÁ·þÎñÆ÷µÄ key/value Êý¾Ý¡£
callback (Callback) : (¿ÉÑ¡²ÎÊý) ÇëÇóÍê³Éʱ(²»ÐèÒªÊÇsuccessµÄ)µÄ»Øµ÷º¯Êý¡£
Õâ¸ö·½·¨Ä¬ÈÏʹÓà GET ·½Ê½À´´«µÝµÄ£¬Èç¹û[data]²ÎÊýÓд«µÝÊý¾Ý½øÈ¥£¬¾Í»á×Ô¶¯×ª»»ÎªPOST·½Ê½µÄ¡£jQuery 1.2 ÖУ¬¿ÉÒÔÖ¸¶¨Ñ¡Ôñ·û£¬À´É¸Ñ¡ÔØÈëµÄ HTML Îĵµ£¬DOM Öн«½ö²åÈëɸѡ³öµÄ HTML ´úÂë¡£Óï·¨ÐÎÈç "url #some > selector"¡£
Õâ¸ö·½·¨¿ÉÒԺܷ½±ãµÄ¶¯Ì¬¼ÓÔØһЩHTMLÎļþ£¬ÀýÈç±íµ¥¡£
ʾÀý´úÂ룺
$(".ajax.load").load("[url]http://www.cnblogs.com/QLeelulu/archive/2008/03/30/1130270.html[/url] .post",
function (responseText, textStatus, XMLHttp ......

jQuery Ajax ʵÀýÑÝʾ


<html>
<head>
<title>jQuery Ajax ʵÀýÑÝʾ</title>
</head>
<script language="javascript" src="../lib/jquery.js"></script>
<script language="javascript">
$(document).ready(function ()
{
   $('#send_ajax').click(function (){
     var params=$('input').serialize(); //ÐòÁл¯±íµ¥µÄÖµ
     $.ajax({
       url:'ajax_json.php', //ºǫ́´¦Àí³ÌÐò
       type:'post',         //Êý¾Ý·¢ËÍ·½Ê½
       dataType:'json',     //½ÓÊÜÊý¾Ý¸ñʽ
       data:params,         //Òª´«µÝµÄÊý¾Ý
       success:update_page //»Ø´«º¯Êý(ÕâÀïÊǺ¯ÊýÃû)
     });
   });
//$.post()·½Ê½£º
$('#test_post').click(function (){
 &nbs ......

jquery Ajax ´«µÝºº×Öµ½ servlet ʱ³öÏÖÂÒÂëµÄÎÊÌâ


jquery Ajax ´«µÝºº×Öµ½ servlet ʱ³öÏÖÂÒÂëµÄÎÊÌâ
2009Äê11ÔÂ25ÈÕ ÐÇÆÚÈý ÏÂÎç 02:28
jquery Ajax ´«µÝºº×Öµ½ servlet ʱ³öÏÖÂÒÂëµÄÎÊÌâ
ÔÚjsÖжÔÐèÒªµÄ´«Ë͵IJÎÊý½øÐбàÂë
encodeURI(encodeURI(param))
ÔÚ·þÎñÆ÷½ÓÊܺó¶ÔÆä½øÐнâÂë
String param = URLDecoder.decode(request.getParameter("param"),"utf-8");
......

[AJAX]AJAXPro2ʹÓÃ

Ò».AjaxProµÄʹÓÃ
1.ÔÚÏîÄ¿ÖÐÌí¼ÓÒýÓã¬ä¯ÀÀÕÒµ½AjaxPro.2.dllÎļþ
2.ÔÚWeb.configÖеÄsystem.webÀïÃæдÈëÒÔÏ´úÂë
</configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>
</system.web>
<//configuration>
3.ÔÚ¼ÓÔØʼþÖУ¬¼ÓÈë
AjaxPro.Utility.RegisterTypeForAjax(typeof(ˈ̞));
4.дµÄ·½·¨¶¼ÒªÓÃ
[AjaxPro.AjaxMethod]¿ªÍ·£¬È»ºóÔÚд·½·¨
5.µ÷ÓÃʱ±ØÐëдÇå³þ
ÃüÃû¿Õ¼äÃû.ÀàÃû.·½·¨£¬Àý:WebUI._Default.getData();
6.µ÷ÓÿɷÖÁ½Öз½·¨(ͬ²½µ÷Óã¬Òì²½µ÷ÓÃ)
//ÔÚºǫ́дµÄÎ޲η½·¨
[AjaxPro.AjaxMethod]
public string getStr()
{
return "hello my friends";
}
//ÔÚºǫ́дµÄÓвη½·¨
[AjaxPro.AjaxMethod]
public string getString(string str)
{
return str + "Say: hello my friends";
}
a.ͬ²½µ÷ÓÃ
(1).ÍÏÈëhtml¿Ø¼þbutton
(2).Ë«»÷,×Ô¶¯ÏÔʾÔÚ.aspxµÄ½Å±¾ÖÐ
(3).ÔÚÀïÃæдÈëÄãÒªÊäÈëµÄÄÚÈÝ
Àý:
//------------------ͬ²½µ÷ÓÃÎÞ²Î-----------
function Button1_onclick()
{
var res=WebUI._Defa ......

Jquery ajax²ÎÊýÉèÖÃ


²ÎÊýÃû
ÀàÐÍ
ÃèÊö
url
String
(ĬÈÏ: µ±Ç°Ò³µØÖ·) ·¢ËÍÇëÇóµÄµØÖ·¡£
type
String
(ĬÈÏ: "GET") ÇëÇó·½Ê½ ("POST" »ò "GET")£¬ Ä¬ÈÏΪ "GET"¡£×¢Ò⣺ÆäËü HTTP ÇëÇó·½·¨£¬Èç PUT ºÍ Delete Ò²¿ÉÒÔʹÓ㬵«½ö²¿·Öä¯ÀÀÆ÷Ö§³Ö¡£
timeout
Number
ÉèÖÃÇëÇó³¬Ê±Ê±¼ä£¨ºÁÃ룩¡£´ËÉèÖý«¸²¸ÇÈ«¾ÖÉèÖá£
async
Boolean
(ĬÈÏ: true) Ä¬ÈÏÉèÖÃÏ£¬ËùÓÐÇëÇó¾ùΪÒì²½ÇëÇó¡£Èç¹ûÐèÒª·¢ËÍͬ²½ÇëÇó£¬Ç뽫´ËÑ¡ÏîÉèÖÃΪ false¡£×¢Ò⣬ͬ²½ÇëÇó½«Ëøסä¯ÀÀÆ÷£¬Óû§ÆäËü²Ù×÷±ØÐëµÈ´ýÇëÇóÍê³É²Å¿ÉÒÔÖ´ÐС£
beforeSend
Function
·¢ËÍÇëÇóÇ°¿ÉÐ޸ĠXMLHttpRequest ¶ÔÏóµÄº¯Êý£¬ÈçÌí¼Ó×Ô¶¨ÒåHTTP Í·¡£XMLHttpRequest ¶ÔÏóÊÇΨһµÄ²ÎÊý¡£
function (XMLHttpRequest) {
  this; // the options for this ajax request
}
cache
Boolean
(ĬÈÏ: true) jQuery 1.2 Ð¹¦ÄÜ£¬ÉèÖÃΪ false ½«²»»á´Óä¯ÀÀÆ÷»º´æÖмÓÔØÇëÇóÐÅÏ¢¡£
complete
Function
ÇëÇóÍê³Éºó»Øµ÷º¯Êý (ÇëÇó³É¹¦»òʧ°Üʱ¾ùµ÷ÓÃ)¡£²ÎÊý£ºXMLHttpRequest&n ......
×ܼǼÊý:703; ×ÜÒ³Êý:118; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [2] [3] [4] [5] 6 [7] [8] [9] [10] [11]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ