Spry framework (1)-XML dataset and display

Source: Internet
Author: User
Introduction:
Spry framework is a lightweight JavaScript library developed by Adobe that supports Ajax. It is HTML-centric and uses the most basic HTML, CSS, and JavaScript to enrich the web page experience.

Test Environment:

Operating System: Windows2003 Server
Browser: ie7.0 RC1 Firefox 1.5.0.7
Web server: IIS 6.0
Spry Database: Spry_P1_3_08-11

Install:
Download the installation package from the http://labs.adobe.com/technologies/spry/. Currently, the packages are spry_p1_3_08-11.zip. After unmounting the package, copy the packages directory to your IIS virtual directory.

Page code:
Data. xml <? XML version = "1.0" encoding = "UTF-8"?>
<Specials>
<Menu_item id = "1">
<Item> summer salad </item>
<Description> organic butter lettuce with apples, blood oranges, gorgonzola, and raspberry vinaigrette. </description>
<Price> 7 </price>
<URL> summersalad. xml? Id = 1 </URL>
</Menu_item>
<Menu_item id = "2">
<Item> Thai now.salad </item>
<Description> lightly sauteed in sesame oil with baby bok choi, Portobello mushrooms, and scallions. </description>
<Price> 8 </price>
<URL> thainoodles. xml </URL>
</Menu_item>
<Menu_item id = "3">
<Item> Grilled Pacific salmon </item>
<Description> served with new potatoes, diced beets, Italian parlsey, and lemon zest. </description>
<Price> 16 </price>
<URL> salmon. xml </URL>
</Menu_item>
</SPECIALS>

Test.html 1 2 <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
3 <title> spry example </title>
4
5 <! -- Link the spry libraries -->
6 <SCRIPT type = "text/JavaScript" src = "Des/XPath. js"> </SCRIPT>
7 <SCRIPT type = "text/JavaScript" src = "des/sprydata. js"> </SCRIPT>
8
9 <! -- Create a data set object -->
10 <SCRIPT type = "text/JavaScript">
11 var dsspecials = new spry. Data. xmldataset ("data. xml", "SPECIALS/menu_item ");
12 </SCRIPT>
13 14
15 <body>
16
17 <! -- Create the spry dynamic region -->
18 <Div id = "specials_div" Spry: region = "dsspecials">
19 <! -- Display the data in a table -->
20 <Table id = "specials_table">
21 <tr>
22 <TH> name </Th>
23 <TH> description </Th>
24 <TH> price </Th>
25 </tr>
26 <tr spry: Repeat = "dsspecials">
27 <TD> {item} </TD>
28 <TD >{description }</TD>
29 <TD> {price} </TD>
30 </tr>
31 </table>
32 </div>
33
34 </body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.