Spry学习(一)----XML数据集及显示
来源:互联网 发布:淘宝无线端首页装修psd 编辑:程序博客网 时间:2024/05/22 10:40
简介:
Spry Framework是Adobe出品的轻量级的支持Ajax的JavaScript库,以HTML为中心,使用最基本的HTML、CSS和JavaScript来实现丰富Web页面体验。
试验环境:
操作系统:windows2003 Server
浏览器:IE7.0 RC1 FireFox 1.5.0.7
WEB服务器:IIS 6.0
Spry库:Spry_P1_3_08-11
安装:
从http://labs.adobe.com/technologies/spry/ 下载安装包,目前版本为Spry_P1_3_08-11.zip,解开后把includes目录复制到自己的IIS虚拟目录上即可。
页面代码:
data.xml
<?xml version="1.0" encoding="UTF-8"?>
<specials>
<menu_item id="1">
<item>夏日沙拉</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 Noodle 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>
<specials>
<menu_item id="1">
<item>夏日沙拉</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 Noodle 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
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Spry Example</title>
<!--Link the Spry libraries-->
<script type="text/javascript" src="includes/xpath.js"></script>
<script type="text/javascript" src="includes/SpryData.js"></script>
<!--Create a data set object-->
<script type="text/javascript">...
var dsSpecials = new Spry.Data.XMLDataSet("data.xml", "specials/menu_item");
</script>
</head>
<body>
<!--Create the Spry dynamic region-->
<div id="Specials_DIV" spry:region="dsSpecials">
<!--Display the data in a table-->
<table id="Specials_Table">
<tr>
<th>名称</th>
<th>Description</th>
<th>价格</th>
</tr>
<tr spry:repeat="dsSpecials">
<td>{item}</td>
<td>{description}</td>
<td>{price}</td>
</tr>
</table>
</div>
</body>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Spry Example</title>
<!--Link the Spry libraries-->
<script type="text/javascript" src="includes/xpath.js"></script>
<script type="text/javascript" src="includes/SpryData.js"></script>
<!--Create a data set object-->
<script type="text/javascript">...
var dsSpecials = new Spry.Data.XMLDataSet("data.xml", "specials/menu_item");
</script>
</head>
<body>
<!--Create the Spry dynamic region-->
<div id="Specials_DIV" spry:region="dsSpecials">
<!--Display the data in a table-->
<table id="Specials_Table">
<tr>
<th>名称</th>
<th>Description</th>
<th>价格</th>
</tr>
<tr spry:repeat="dsSpecials">
<td>{item}</td>
<td>{description}</td>
<td>{price}</td>
</tr>
</table>
</div>
</body>
- Spry学习(一)----XML数据集及显示
- Spry学习(二)----XML数据集及主从表显示
- Spry学习(三)----XML数据集排序
- Spry学习(四)----数据集过滤及淡入淡出效果
- spry动态数据集
- Spry学习(五)----框架结构
- spry
- 交换数据学习一:将xml文本读取到DataSet并显示
- Android学习之ListView显示XML数据
- android 数据库 SQLiteOpenHelper和ContentProvider学习笔记---添加数据及显示(一)
- XML学习笔记(一)---概述及语法
- XML学习笔记(一):XML基础及语法
- 从XML中读取数据!(Asp.net 学习一)
- javaweb学习笔记(一)-xml概述及语法
- (AJAX学习二) XHR及JQuery处理XML数据
- WPF读写config配置文件及XML数据的学习
- TensorFlow 学习(二) 制作自己的TFRecord数据集,读取,显示及代码详解
- TensorFlow学习笔记(二十四)自制TFRecord数据集 读取、显示及代码详解
- Window.ShowModalDialog使用手册
- 上海太保P05项目——PARTITION_KEY解决方案
- [原创]【新歌推荐】许巍《风行》[李宁逐风跑鞋广告歌]
- Java正则表达式入门文档
- 获取datagrid中光标所在行的某列的值
- Spry学习(一)----XML数据集及显示
- 在Tomcat上配置struts2环境时遇到 “Error filterstart” 问题的解决方法
- 不知道写什么了
- Asp.net 2.0 用C# 创建 PDF文件[引用] (示例代码下载)
- Spry学习(二)----XML数据集及主从表显示
- 牛刀小试---浅谈Spring如何整合WEB应用程序,Ibatis(2)!
- Win32 API函数
- Java 视频捕获(JMF)
- 重启机器/待机/睡眠等状态