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);
}
Ïà¹ØÎĵµ£º
Ò»¡¢¸ÅÊö
Marquee£ºHtmlÖйöÆÁ¿Ø¼þ£¬¿ÉÒÔʹ°üº¬Ôڴ˱ê¼ÇÖеÄÄÚÈݽøÐи÷¸ö·½Ïò£¬¸÷ÖÖËٶȵĹö¶¯£¬Òò´ËÔÚ²»¿¼ÂÇʹÓõÚÈý·½¿Ø¼þµÄǰÌáÏ£¬¿¼ÂÇʹÓÃMarquee+xmlhttpÀ´ÊµÏÖ¶¨´Î¸üÐÂÒ³ÃæÖеĹö¶¯ÄÚÈÝ£¬´ËʵÏÖÔÚIE6.0¼°ÒÔÉϰ汾²âÊÔͨ¹ý£¬ÆäËûä¯ÀÀÆ÷ÔÝʱδ²âÊÔ¹ý¡£
MarqueeÖеÄonfinishʼþ£ºÔÚ¸øMarqueeÊôÐÔloop¸ ......
½ñÌì°ïͬʽâ¾öÁËjsÒì²½µ÷ÓÃʱ³öÏÖÁËÖÐÎÄÂÒÂëµÄÎÊÌ⣬¾ßÌå½â¾ö°ì·¨ÈçÏ£º
1£©Ê×ÏÈÈ·ÈÏjsÊÇ·ñûÓжԺǫ́´«Êä¹ýÀ´µÄÖÐÎĽøÐнâÂë¡£
°´ÕÕÍøÂçÉÏдµÄ·½·¨Í¨¹ýjs¶ÔresponseµÄ¶ÁÈ¡³öÀ´Êý¾Ý½øÐжà´Î²âÊÔ£¬·¢ÏÖÈÔÈ»²»Äܽâ¾ö£¬Ï¸Ïë²»Ò»¶¨ÊÇ´Ë´¦ÎÊÌâ¡£¸Ä»»ÆäËû°ì·¨½â¾ö¡£
2£©Èç¹û½âÂë½â¾ö²»ÁË£¬ÔÙ¿´ÊÇ·ñÊÇÒòÎªÍø ......
20 ¸ö¾µäµÄ Ajax + CSS ±í¸ñ
²¢²»ÊÇËùÓеÄWeb ¿ª·¢Õß¶¼»á¶ÔÃÀ»¯±í¸ñÊý¾Ý¸ÐÐËȤ£¬½ñÌìÎÒÃÇÊÕ¼¯ÁË20 ¸ö¹¦ÄÜÇ¿´ó£¬Íâ¹ÛƯÁÁµÄ»ùÓÚAjax + CSS µÄ±í¸ñЧ¹û£¬Äã¿ÉÒÔ´ÓÕâЩʾÀýÖÐѧϰÔõôʹÓÃÕâЩ±í¸ñÌṩµÄÅÅÐòºÍ¹ýÂ˵ŦÄÜÀ´×éÖ¯±í¸ñÖеÄÊý¾Ý¡£
ÏÖÔÚÈÃÎÒÃÇÀ´¿´¿´ÕâЩ±í¸ñ£º£¨µã»÷ÿ¸öÑùÊ½Ç°ÃæµÄÁ´½Ó¼´¿É½øÈëÏÂÔØ£©
¡¡¡¡#1. ......
AjaxÌá½»Êý¾ÝÒ»°ã¶¼ÊÇͨ¹ýURLºó±ßµÄ²ÎÊýÐÎʽÀ´´«µÝÊý¾ÝµÄ£¬±ÈÈçʹÓÃXMLHttpRequest.open('POST', url, true);µÄ·½Ê½Ê¹ÓÃʱ£¬Æäurl²ÎÊýÖоͰüº¬ÁËÐèÒªÌá½»µÄÊý¾Ý£¬ËüµÄÐÎʽÈ磺http://www.mysite.com/handler.do?name='²Ü²Ù'&sex='ÄÐ'£¬ÊǰÑkey=valueÐÎʽµÄÊý¾Ýͨ¹ý &·ûºÅÁ¬½ÓÆðÀ´£¬ ......