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

Ajax ʵÏÖ


ÔÚÒѾ­·¢²¼µÄ ASP.NET2.0 ÖУ¬ÎÞË¢ÐÂÒ³Ãæ¿ª·¢Ïà¹Ø²¿·Öͬ beta2 Óв»Éٸ͝¡£¶øÇÒÔÚÔ½À´Ô½¶àµÄ Ajax ¿ª·¢°ü±»¿ª·¢³öÀ´µÄÇé¿öÏ£¬ ASP.NET2.0 ×Ô´øµÄÎÞË¢ÐÂÒ³Ãæ¼¼ÊõûÓб»ºÜ¶àÈËÁ˽⣬ÉõÖÁ²»ÉÙÈËÈÏΪ¸Ã¹¦ÄÜÓÐЩ“¼¦Àß”¡£µ«Èç¹ûÎÒÃǽö½öÊÇÔÚ³ÌÐòÖмÓÈëºÜÉÙ²¿·ÖµÄ Ajax ÌØÐÔ£¬ Atlas ¡¢ Ajax.Net µÈ¾ÍÏÔµÃÓÐЩ“ɱ¼¦ÓÃÅ£µ¶”µÄ¸Ð¾õÁË¡£¶øÇÒ£¬ÎÒÈÏΪʹÓà ASP.NET2.0 ÌṩµÄ·½·¨½øÐпª·¢²¢²»ºÜ¸´ÔÓ£¬Ïà·´£¬Ê¹ÓúÜÉٵĴúÂë¾Í¿ÉÒÔ×ö³öÀ´ºÜ°ôµÄЧ¹û£¡
   ÏÂÃæÎÒÀ´Ò»²½Ò»²½µÄ´ø´ó¼Ò¿ª·¢ÎÞˢеÄÒ³Ãæ£¡
 µÚÒ»²½£ºÊµÏÖ ICallbackEventHandler ½Ó¿Ú
   ICallbackEventHandler½Ó¿ÚλÓÚSystem.Web.UIÃüÃû¿Õ¼äÏ¡£ÔÚbeta2ʱ£¬ICallbackEventHandlerÖ»°üº¬Ò»¸öRaiseCallbackEvent·½·¨£¬¼´´¦Àí»Øµ÷ʼþ£¬ÓÖ·µ»Ø´¦Àí½á¹û¡£ÔÚÕýʽ°æÖУ¬Ëü±ä³ÉÁ˰üº¬GetCallbackResultºÍRaiseCallbackEventÁ½¸ö³ÉÔ±·½·¨£¬µÚÒ»¸öÓÃÀ´·µ»Ø»Øµ÷ʼþµÄ½á¹û£¬µÚ¶þ¸öÓÃÀ´³öÀ´»Øµ÷ʼþ¡£Õâ¸ö±ä»¯Ö÷ÒªÊÇΪÁ˱àдWeb¿Ø¼þ¶ø×öµÄ¸Ä¶¯£¬¾ßÌå¿ÉÒÔ¿´Ò»ÏÂGridViewµÈ¿Ø¼þÖеÄʵÏÖ´úÂë¡£
½¨Á¢Ò»¸ö Web ÍøÕ¾£¬ÎÒÃÇÀ´ÐÞ¸Ä default.aspx.cs Îļþ£º
 1       public  partial class  _Default : System.Web.UI.Page, ICallbackEventHandler
 1     private string str;
 2     public void RaiseCallbackEvent(string eventArgument)
 3     {
 4         //¿ÉÒÔ¸ù¾Ý´«µÝµÄ²ÎÊý²»Í¬£¬µ÷Óò»Í¬µÄ´¦ÀíÂß¼­
 5         str = "´Ó·þÎñÆ÷¶Ë·µ»ØµÄÄÚÈÝ£º" + eventArgument;
 6     }
 7 
 8     public string GetCallbackResult()
 9     {
10         return str;
11     }
12 
  µÚ¶þ²½£º×¢²á»Øµ÷·½·¨
   ÎÒÃÇÔÚ default.aspx Ò³ÃæÖÐÌí¼ÓÒ»¸ö TextBox £¬Ò»¸ö Label ºÍÒ»¸ö Html ¿Ø¼þ Button £¬²¢¸ø Button Ìí¼Ó onclick ʼþ£º
1 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
2 <input id="Button1


Ïà¹ØÎĵµ£º

Ajax¿çÓò·ÃÎÊ


AjaxÖ±½Ó¿çÓò·ÃÎÊ£¬»á³öÏÖûÓÐȨÏ޵ĴíÎó£¬Ò»¸ö±È½Ï¼òµ¥¿ÉÐеĽâ¾ö·½°¸ÈçÏ£º
×öÒ»¸ö ajaxÇëÇóµÄ ´úÀíservlet »òÕßjsp£¬
ajaxÇëÇóservlet»òjsp´úÀí£¬ÓÉservlet»òjsp´úÀíÈ¥ÇëÇóajaxÒª·ÃÎʵÄaction£¬È»ºóÔÙ½«actionµÄÏìÓ¦ÐÅÏ¢·µ»Ø¸øajax¼´¿É£¬
servlet»òjsp³äµ±ÖнéÈ˵ĽÇÉ«
servlet »ò jsp ´úÀíµÄ  ºËÐÄ´úÂëÈçÏ£ ......

ajax ÂÒÂë

function verify() {
//½â¾öÖÐÎÄÂÒÂéÎÊÌâµÄ·½·¨1£¬Ò³Ãæ¶Ë·¢³öµÄÊý¾Ý×÷Ò»´ÎencodeURI£¬·þÎñÆ÷¶ÎʹÓÃnew String(old.getBytes("iso8859-1"),"UTF-8");
//½â¾öÖÐÎÄÂÒÂéÎÊÌâµÄ·½·¨2£¬Ò³Ãæ¶Ë·¢³öµÄÊý¾Ý×÷Á½´ÎencodeURI£¬·þÎñÆ÷¶ÎʹÓÃURLDecoder.decode(old,"UTF-8")
var url = &qu ......

jquery php ajax json

just get a json
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<mce:script src="jquery-1.3.2.min.js" mce_src="jq ......

php jquery Ajax Ìá½»¡¢¶ÁÈ¡ json

<mce:script type="text/javascript" language="javascript"><!--
function del(com_id,meet_id){
$.ajax({
url:'../company/meet.Ajax.php',
type:'POST',
data:{com_id:com_id,meet_id:meet_id},
dataType:"json",
timeout: 10 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ