<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="jtjs/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="jtjs/jquery.tmpl.js"></script>
<script >{{html Synopsis}}</td>
</tr>
</script>
<style>
td{
border:solid 1px red}
</style>
</head>

<body>
<table>

  <theadclass="header">

    <tr>

      <th>Title</th>

      <th>Synopsis</th>

    </tr>

  </thead>
  <tbody >

var movies = [
{
Title: "测试", 
Synopsis: "测试内容"
},
{
Title: "测试2",
Synopsis: "测试内容"
}
];

$( "#movieT" ).tmpl( movies )
.appendTo( "#movieList" );

</script>
</body>
</html>

 

-------------------------------------------------------------

1.${属性名} --->直接就可以用json里的属性名取值

 

2. {{html 属性名}} ----->必须是双{} 然后通过html 属性名取值

-------------------------------------------------------------

赋值

$( "#movieT" ).tmpl( movies ).appendTo( "#movieList" );

相关文章:

  • 2022-01-04
  • 2021-06-01
  • 2021-11-12
  • 2022-01-18
  • 2021-09-01
  • 2021-12-15
  • 2021-11-12
  • 2022-02-19
猜你喜欢
  • 2021-10-09
  • 2021-12-10
  • 2022-12-23
  • 2022-01-11
  • 2021-10-26
  • 2021-08-08
  • 2021-10-14
相关资源
相似解决方案