Ajax£ºÓµ±§JSON£¬ÈÃXML×ß¿ª
Ajax(Asynchronous JavaScript and XML)˵µ½µ×¾ÍÊÇÒ»ÖÖä¯ÀÀÆ÷Òì²½¶ÁÈ¡·þÎñÆ÷ÉÏXMLÄÚÈݵļ¼Êõ¡£ÏÖÔڵļ¼Êõ·²ÊǸúXML³¶ÉϹØϵ£¬ÔÙ¼ÓÉϸö¸ÅÄî×ö»Ï×Ó£¬¾ÍÏñ½ð×°ÁËÒ»Ñù£¬×§µÃ²»ÐС£ÃÅÍâ µÄÈË¿´µÃºÜÊÇÈÈÄÖ£¬ÃÅÀïµÄÈËÒ¡Ò¡Í·²»ÍâÈçÊÇ¡£XMLÄØ£¬¿çƽ̨µÄг±ÓïÑÔ£¿ÆäʵXML£½TXT¡£
XMLÖ»ÊÇ·ûºÏºÜ¶à¹æ·¶µÄÎı¾¡£Ëü±¾Éíʲô¶¼²»ÊÇ£¬Ö»ÊDZ£ ´æ×Ö·ûµÄÎļþ¡£¶øä¯ÀÀÆ÷Òì²½¶ÁÈ¡µÄÖ»ÊÇ·þÎñÆ÷ÉϵÄÎı¾ÄÚÈÝ£¬ËùÒÔÔÚAjax¿ª·¢Ê±ÍêÈ«²»±Ø¾ÐÄàÓÚXML¡£[°æȨËùÓУ¬www.jialing.net]
JSONµÄÀ´Àú
XML µÄ×÷ÓÃÊǸñʽ»¯Êý¾ÝÄÚÈÝ¡£Èç¹ûÎÒÃDz»ÓÃXML»¹ÓÐʲô¸üºÃµÄ·½·¨Âð£¿Õâ¸ö´ð°¸ÊÇJSON¡£½éÉÜJSON֮ǰÎÒÏȽéÉÜÒ»ÏÂJavaScriptÕâÃŽű¾Óï ÑÔ¡£½Å±¾ÓïÑÔ×ÔÉíÓж¯Ì¬Ö´ÐеÄÌ츳¡£¼´ÎÒÃÇ¿ÉÒÔ°ÑÏëÒªÖ´ÐеÄÓï¾ä·ÅÔÚ×Ö·û´®Àͨ¹ýeval()Õâ¸ö¶¯Ì¬Ö´Ðк¯ÊýÀ´Ö´ÐС£×Ö·û´®ÀïµÄÄÚÈÝ»áÏñÎÒÃÇдµÄ½Å±¾ Ò»Ñù±»Ö´ÐС£
ʾÀý1£º
<HTML>
<HEAD>
<TITLE>eval example 1</TITLE>
</HEAD>
<BODY>
<script>
str = "alert('hello')";
eval(str);
</script>
</BODY>
</HTML>
´ò¿ªÒ³Ãæ»áµ¯³öhello´°¿Ú¡£
ÎÒÃÇ¿ÉÒÔÔÚ×Ö·û´®ÖзÅÈκνű¾Óï¾ä£¬°üÀ¨ÉùÃ÷Óï¾ä£º
<HTML>
<HEAD>
<TITLE>eval example 2</TITLE>
</HEAD>
<BODY>
<script>
define = "{name:'Michael',email:'17bity@gmail.com'}";
eval("data = "+define);
alert("name:"+data.name);
alert("email:"+data.email);
</script>
</BODY>
</HTML>
Èç¹ûÎÒÃÇÔÚºǫ́Òì²½´«À´µÄÎı¾ÊÇJavaScriptµÄÉùÃ÷Óï¾ä£¬ÄÇô²»ÊÇÒ»Ìõeval·½·¨¾ÍÄܽâÎöÁË£¿¶ÔÓÚ½âÎö¸´ÔÓµÄXML£¬ÕâÑùµÄЧÂÊÊǶàô´óµÄÌá¸ß°¡£¡
ÏÖÔÚ¾ÍÀ´¸æËßÄãʲôÊÇJSON£ºJavaScript Object Notation¡£ÎÒ¸üÔ¸Òâ°ÑËü·ÒëΪJavaScript¶ÔÏóÉùÃ÷¡£±ÈÈçÒª´Óºǫ́ÔØÈëһЩͨѶ¼µÄÐÅÏ¢£¬Èç¹ûд³ÉXML£¬ÈçÏ£º
<contact>
<friend>
<name>Michael</name>
<email>17bity@gmail.com</email>
<homepage>http://www.jialing.net</homepage>
</friend>
<friend>
<name>John</name>
<email>john@gmail.com</email>
<homepage>http://www.john.com</homepage>
</friend>
<friend>
<name>Peggy</name>
<email>peggy@gm
Ïà¹ØÎĵµ£º
Òë×ÔVault API°ïÖúÎĵµÖÐһƪ Doug RedmondдµÄknowledgebase article. Doug's ²©¿ÍÊÇ It's All Just Ones and Zeros
ÄãÒ²Ðí²»ÖªµÀËùÓÐVault API À඼¿ÉÒÔ XML ÐòÁл¯ - ÕâÒâζןÜÈÝÒ×°ÑAPI¶ÔÏóת»»Îª XML Îı¾£¬·´Ö®ÒàÈ»¡£
ºÜ¶àÖÖÇé¿öÏ¿ÉÒÔʹÓô˹¦ÄÜ£¬ÀýÈ磺
Ëü¿ÉÒÔ°ïÖúÄúµ÷ÊÔ´úÂë¡£Èç¹ûÄú¾ßÓдóÁ¿Êý¾ÝµÄ¶ÔÏ ......
Google Search API
²Î¿¼Êé¼®£ºGoogle API´óÈ«—±à³Ì?¿ª·¢?ʵÀý
Êé¼®¶Ô¼¸Ê®ÖÖGoogle³£ÓÃAPI½øÐÐÁËÊáÀíºÍ½éÉÜ£¬¸¨ÒÔÐÐÖ®ÓÐЧµÄ´úÂëʵÀý
http://code.google.com/intl/zh-CN/apis/ajaxsearch/documentation/
1£©Google Site Search
GoogleÕ¾µãÄÚǶËÑË÷µÄʹÓ÷½·¨
<%@ page language="java" contentType="text/ht ......
Class.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="class.css"?>
<bookdetail>
<book class="A">
<author>²ÜÑ©ÇÛ</author>
<title>ºìÂ¥ÃÎ</title>
<price>60.00</price>
</book>
<book class="A"& ......
ID.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="ID.css"?>
<bookdetail>
<book class="A" id="B1">
<author>²ÜÑ©ÇÛ</author>
<title>ºìÂ¥ÃÎ</title>
<price>60.00</price>
</book>
<book class="A ......
¶ÁXMLÎļþ
DataSet books = new DataSet();
books.ReadXml(MapPath("booklist.xml"));
booklist.DataSource = books;
booklist.DataBind(); ......