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

IDE ȱÉÙ»ù´¡ÄÜÁ¦¼¯µ÷Óÿ⣬ÕâÊÇÒ»¸ö¼òµ¥µÄAjaxµ÷Óá£

var jsonObj;
var xmlhttp = null;
function callAsync(url, callbackSuccess)
{
 xmlhttp = new Ajax();
 xmlhttp.open("GET", url, true);
 xmlhttp.onreadystatechange=function()
 {
  // readyState = 4 ; "complete"
  if (xmlhttp.readyState==4)
  {
   // status = 200 ; "ok"
   if(xmlhttp.status == 200)
   {
    uiManager.showNotification(1000, "ok", "Done");
    /*
     *  Remove the substr "jsonFlickrApi(" from the responseText
     */
    var text = xmlhttp.responseText;
    text = text.substr(14, text.length-15);
 
    // Create JSON Oject
    jsonObj = eval('(' + text + ')');
    
    callbackSuccess(jsonObj);
   }
   else
   {
    uiManager.showNotification(1000, "warning", "Failed to get data from server");
   }
  }
 }
 xmlhttp.send(null);
}


Ïà¹ØÎĵµ£º

ajaxµÄ³õ¼¶Ó¦ÓÃ

×ªÔØÓÚhttp://xzio.javaeye.com/blog/91713
×î³õ¿´µ½ajax¸Ð¾õºÃ¾ªÏ²°¡£¬²»ÓÃË¢ÐÂÈ«²¿Ò³Ã棬¾Í¿ÉÒÔ¸ü¸Ä¾Ö²¿Ò³ÃæÊý¾Ý¡£ÕæµÄºÜ·½·¨
µ«ÊÇÒÔΪ»áºÜÄÑ£¬µ«Êµ¼Ê×öÁ˲ÅÖªµÀ£¬AJAXºÜ¼òµ¥¡£ÖÁÉÙÈëÃźܼòµ¥ Èç¹ûÄã»áajaxÄǾͲ»Òª¿´ÁË¡£¸ü²»ÒªÂîÎÒ¡£±ÈÎÒÅ£µÄÈËÌ«¶àÁË
»¥ÏཻÁ÷£¬Ñ§Ï°¡£MSN:whw_dream(AT)hotmail.com
Ê×ÏÈÊÇjspÒ³ÃæºÍ ......

jsQuery ajax test

test.html
<!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"
conten ......

AJAX (XHR)Òì²½ÇëÇóµÄһЩÈÏʶ

function sendAsynchronRequest(url,parameter,callback){
 createXMLHttpRequest();
 if(parameter == null){
  xmlHttp.onreadystatechange = callback;
  xmlHttp.open("GET",url,true);//µ±GETÇëÇóʱ£¬ÔÚµØÖ·À¸ÖÐÊÇ´ø²ÎÊýµÄ£¬¶ø²ÎÊýΪNULL£¬ËùÒÔÓÃgetÇëÇó£¬send(null)
   ......

¾«Í¨ Grails: ʹÓà Ajax ʵÏÖ¶à¶Ô¶à¹ØÏµ

ÔÚ Web Ó¦ÓóÌÐòÖУ¬¶à¶Ô¶à£¨m:m£©¹ØÏµºÜÄÑ´¦Àí¡£ÔÚ ¾«Í¨ Grails ϵÁеÄÕâÒ»ÆÚÎÄÕÂÖУ¬Scott Davis ½«ÏòÄúչʾÈçºÎÔÚ Grails Öгɹ¦ÊµÏÖ m:m ¹ØÏµ¡£Á˽âÈçºÎͨ¹ý Grails ¶ÔÏó¹ØÏµÓ³É䣨Grails Object Relational Mapping£¬GORM£©API ºÍºó¶ËÊý¾Ý¿â´¦Àí¶à¶Ô¶à¹ØÏµ¡£Ñ§Ï°ÈçºÎʹÓà Ajax£¨Asynchronous JavaScript + XML£©Á÷Ïß»¯ ......

10¸ö·Ç³£°ôµÄAjax¼°JavascriptʵÀý×ÊÔ´ÍøÕ¾

1.Ajax Rain
¡¡¡¡AjaxRainÓкܶàÍêÃÀÕûºÏAJAX, CSS, DHTML »ò JavascriptµÄʵÀý£¬ÓÐһЩDemoµÄÈ·ÖµµÃÄãÈ¥¿´Ò»¿´£¬¼´Ê¹Äã²»ÊÇÍøÒ³Éè¼Æ(¿ª·¢)ʦ¡£
Ajax/JavascriptʵÀý:
 EXT JS Date Picker
 jQuery Feed Menu
 jGrowl
 FastFind Menu – Jquery
 Spiffy Accordion
2.Ajax Daddy
¡¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ