Ajax ºÍ XML: ÎåÖÖ³£¼û Ajax ģʽ
ºÃ¾Ã²»ÅöWEBµÄ¶«¶«ÁË,×î½üѧϰ£Ó£Á£ÐµÄ£Â£Ó£Ð¼¼Êõ£¬ÓÖÓõ½ÕâЩ£¬Ë³±ãתƪÎÄÕ£¬±¸²é£®
ÔÎĵØÖ·: http://www.ibm.com/developerworks/cn/xml/x-ajaxxml2/
Ajax ºÍ XML:
Îå
ÖÖ³£¼û Ajax ģʽ
¿ÉÁ¢¼´Ê¹ÓÃÕâЩ·Ç³£ÓÐÓÃµÄ Ajax Éè¼Æģʽ
ÎĵµÑ¡Ïî
<tr valign="top"><td width="8"><img alt="" height="1" width="8" src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt="" width="16" height="16" src="//www.ibm.com/i/c.gif"/></td><td class="small" width="122"><p><span class="ast">δÏÔʾÐèÒª JavaScript µÄÎĵµÑ¡Ïî</span></p></td></tr>
¼¶
±ð£º Öм¶
Jack D
Herrington
(jherr@pobox.com
),
¸ß¼¶Èí¼þ¹¤³Ìʦ, Leverage Software Inc.
2007 Äê 3 ÔÂ 20 ÈÕ
Asynchronous
JavaScript + XML£¨Ajax£©ÎÞÒÉÊÇ 2006 Äê×îÈÈÃŵļ¼ÊõÊõÓÇÒÓÐÍûÔÚ 2007
µÃµ½½øÒ»²½·¢Õ¹¡£µ«ÊǶÔÄúµÄÓ¦ÓóÌÐòÀ´ËµËü¾¿¾¹ÓÐʲôÒâÒåÄØ£¿Ajax Ó¦ÓóÌÐòÖÐÄÄÒ»ÖÖ³£¼û¼Ü¹¹Ä£Ê½Ó¦ÓÃ×î¹ã·ºÄØ£¿±¾ÎĽ«½éÉÜÎåÖÖ³£¼û Ajax
Éè¼Æģʽ£¬¿ÉÒÔʹÓÃËüÃÇ×÷Ϊ¹¤×÷µÄ»ù´¡¡£
µÄÈ·£¬Ajax ÊÇ Web 2.0
ÈÈÃÅÊõÓËùÓÐÈ˶¼Ï£Íû½«ÆäÓ¦ÓÃÓÚ×Ô¼ºµÄÕ¾µã¡£µ«ÊÇËü¶ÔÎÒÃǾ¿¾¹ÓÐʲôÒâÒ壿¹¤³Ìʦ¸ÃÈçºÎÔڼܹ¹µÄ²ãÃæÉϽ«Æ伯³Éµ½×Ô¼ºµÄÕ¾µãÖУ¿ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ½«½éÉÜ
Ajax µÄ»ù±¾ÖªÊ¶£¬²¢Õ¹Ê¾Ò»Ð©ÒѾ³ÉΪ Web 2.0 ¿ª·¢×î¼Ñʵ¼ùµÄ Ajax Éè¼Æģʽ¡£
Çë·ÃÎÊ Ajax ¼¼Êõ×ÊÔ´ÖÐÐÄ
£¬ÕâÊÇÓйØ
Ajax ±à³ÌÄ£ÐÍÐÅÏ¢µÄһվʽÖÐÐÄ£¬°üÀ¨ºÜ¶àÎĵµ¡¢½Ì³Ì¡¢ÂÛ̳¡¢blog¡¢wiki ºÍÐÂÎÅ¡£ÈκΠAjax µÄÐÂÐÅÏ¢¶¼ÄÜÔÚÕâÀïÕÒµ½¡£
Ê×ÏÈ£¬Ajax
½ö½öÊÇÒ»¸öÉæ¼°Ò»×é¼¼ÊõµÄÊõÓ°üÀ¨ Dynamic HTML£¨DHTML£©ºÍ XMLHTTPRequest
¶ÔÏó¡£DHTML ÓÉÈý¸öÔªËØ×éºÏ¶ø³É£¬ËüÃÇ·Ö±ðÊdz¬Îı¾±ê¼ÇÓïÑÔ£¨Hypertext Markup
Language£¬HTML£©¡¢JavaScript ´úÂëºÍ¼¶ÁªÑùʽ±í£¨Cascading Style Sheet£¬CSS£©¡£ÔÚ Web Ò³ÃæʹÓÃ
JavaScript ´úÂ룬¿ÉÒÔ¶¯Ì¬µØ¸Ä±äÒ³Ã棬°üÀ¨Ìí¼Ó¡¢É¾³ý»ò¸ü¸ÄÒ³ÃæÄÚÈÝ¡£Õâ¾ÍÊÇ DHTML µÄ¶¯Ì¬
²¿·Ö¡£JavaScript ´úÂëʹÓà XMLHTTPRequest
¶ÔÏóÔÚ¼ÓÔØÒ³ÃæºóÏò·þÎñÆ÷ÇëÇóÊý¾Ý¡£
ÕâÁ½ÖÖÔªËصÄ×éºÏ —— ´Ó·þÎñÆ÷¶¯Ì¬Çë
Ïà¹ØÎĵµ£º
Flex ºÍC++ Ö®¼ä´«Êä½á¹¹ÌåÊý¾Ý
Ò»Ö±ÏëÊÔÑéÓýṹÌå´«Êý¾Ý
µ«ÊÇFlex ºÍC++ µÄÀàÐÍËùÕ¼µÄ×Ö½ÚÊýÓÐʱ²»Ò»Ñù
Èçint ÔÚC++ÖÐÕ¾2¸ö×Ö½Ú£¬¶øÔÚFlexÖÐÕ¼4¸ö×Ö½Ú¡£
ת»»±È½ÏÂé·³¡£
×îºó¾ö¶¨ÓÃXML½øÐд«Êä
È»ºóÁ½±ß¶¼¼ÓÒ»¸öXML ½âÎöºÍ·â×°Àà¡£
C++ ¶ËʹÓõÄtinyXML Àà
FlexÖ±½ÓʹÓÃ×Ô¼º´øµÄ E4X Àà
Flex´úÂëÈçÏÂ
&nb ......
Ñо¿E4XÓëFlexµÄ¹Øϵ£¬ËùÒÔ´òËã×ܽáһϣ¬ÓÐ˵µÄ²»¶ÔµÄµØ·½£¬»¹Çë´ó¼Ò¶à¶àÔÁ¡£
Ò»¡¢×î¼òµ¥Ä£Ê½£ºFlexͨ¹ýhttpserviceºÍdataProvider½øÐÐÊý¾Ý´«Êä
Xml¸ñʽÈçÏ£º
<?xml version="1.0" encoding="utf-8" ?>
<Result>
<NodeA>value1</NodeA>
<NodeB>valve2</NodeB>
…&he ......
ÔÚJ2MEÌåϵÖУ¬¶ÔxmlµÄ½âÎöÓбȽÏÓÐÃûµÄµÚÈý·½½âÎöAPI£¬·Ö±ðΪKXMLºÍNanoXML£¬ËûÃǶ¼ÌṩÁ˶ԽâÎöxmlµÄÖ§³Ö¡£KXMLÔÚ½âÎöXML¹ý³ÌÖлá¶ÔÎļþÄÚÈÝÒ»²ãÒ»²ã½øÐнâÎö£¬Òò´Ë³ÉΪÔöÁ¿Ê½½âÎöÆ÷£¬±È½ÏÊʺϴóÎļþµÄ½âÎö¡£¶øNanoXMLÊÇÒ»´ÎÐÔ½âÎöÆ÷£¬ÔÚÒ»´Îʱ¼äÀï¾Í°ÑÕû¸öxmlÎĵµ½âÎöÍ꣬Òò´Ë²»ÊʺϴóÎļþµÄ½âÎö£¬»áÔì³ÉÄÚ´æ²»×ãµÄÏÖÏó¡ ......
<html>
<body>
<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Inte ......