日期:2014-05-17  浏览次数:20767 次

datasrc在非IE下如果实现?
本帖最后由 lujianwen 于 2013-04-07 16:23:31 编辑
以下代码在非IE下如果实现?
<html>
<body>
    <xml id="xmldso">
        <data>
         <row>
          <col1>65</col1>
          <col2>hr</col2>
          <col3>hssd</col3>
         </row>
        </data>
    </xml>
    <xml id="xmldso0"></xml>
    <table id="tbl1" border datasrc="#xmldso0">
        <thead>
            <tr>
                <th>
                    col1</th>
                <th>
                    col2</th>
                <th>
                    col3</th>
            </tr>
        </thead>
        <tr>
            <td>
                <span datafld="col1" />
            </td>
            <td>
                <span datafld="col2" />
            </td>
            <td>
                <span datafld="col3" />
            </td>
        </tr>
    </table>

    <script>
xmldso0.loadXML(xmldso.xml);
function change(){
  xmldso0.loadXML(xmldso2.xml);
}
    </script>
</html>
xml js datasrc

------解决方案--------------------
其他浏览器不支持xml数据岛,数据保存为一个xml文件,然后javascript加载xml文件分析生成html代码