zoukankan      html  css  js  c++  java
  • javascript将xml文件绑定到table上

    <html>
    <head>
    <title>绑定到Table</title>
    </head>
    <body>
    <xml id="cdcat" src="被绑定table.xml" tppabs="将XML文件绑定到Table.xml"></xml>
    <table border="1" datasrc="#cdcat">
    <thead>
    <tr><th>演唱者</th><th>歌名</th></tr>
    </thead>
    <tfoot>
    <tr><th colspan="2">这是我喜欢的CD</th></tr>
    </tfoot>
    <tbody>
    <tr>
    <td><span datafld="artist"></span></td>
    <td><span datafld="title"></span></td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>

     

    被绑定table.xml文件如下:

    <?xml version="1.0" encoding="utf-8" ?>
    <cd>
       <cdcat>
          <artist>jay</artist>
          <title>她的睫毛</title>
       </cdcat>
       <cdcat>
          <artist>Eason</artist>
          <title>爱情呼叫转移</title>
       </cdcat>

    </cd>

     

     

    上述代码使用了Web设计中XML数据岛的相关知识,要注意标注同样颜色的代码。

  • 相关阅读:
    作业16
    递归函数
    三元表达式与生成式
    迭代器与生成器
    作业15
    装饰器
    作业14
    string的入门与进阶
    修理牧场(优先队列)
    旅游规划
  • 原文地址:https://www.cnblogs.com/ccsbb/p/2032023.html
Copyright © 2011-2022 走看看