zoukankan      html  css  js  c++  java
  • JTemplates使用方法源码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title>jtemplates jquery模板引擎使用-LIEHUO.NET</title>
    <script src="/Scripts/jquery-1.3.2.js" type="text/javascript"></script>
    <script src="/Scripts/plugins/jquery-jtemplates.js" type="text/javascript"></script>

    <script type="text/javascript">
    $(document).ready(function() {
    var data = [{ name1: "测试信息",id:"12" },{ name1: "测试信息",id:"12" }];
    $("#result").setTemplateElement("template1");
    $("#result").processTemplate(data);
    });
    </script>
    </head>
    <body>
    <div>
    <textarea id="template1" >
    <table>
    <thead>
    <tr>
    <td colspan="2">
    fdaasfd
    </td>
    </tr>
    </thead>
    <tbody>
    {#foreach $T as r}
    <tr>
    <td>
    name:{$T.r.name1}
    </td>
    <td>
    id:{$T.r.id}
    </td>
    </tr>
    {#/for}
    </tbody>
    <tfoot>
    </tfoot>
    </table>
    </textarea>
    </div>

    <div id="result"></div>
    </body>
    </html>

  • 相关阅读:
    七牛云的 python sdk 是如何 批量删除资源的
    mysql 主从复制
    django3上线部署踩的坑
    基于linux在线预览
    数据库2
    数据库3
    安装 webstorm--->vue
    Django基础1
    pymysql基础
    前段之jQuery
  • 原文地址:https://www.cnblogs.com/guozhe/p/2352721.html
Copyright © 2011-2022 走看看