使用把手在JSON </li> </ul>中返回特定的<ul> <li>标签

时间:2014-05-19 13:57:27

标签: javascript jquery html css handlebars.js

我的javascript中有以下JSON对象:

var source = $("#template").html();
var template = Handlebars.compile(source);

var igListOrig = [
  {
    "IG":"Problem Solving", 
    "AIR_Indicators": "All Domain 1 Indicators* 3.1, 3.2, 3.3,     3.4", 
    "SMP": "SMP 1, 2, 3, 4, 5, 6, 7, and 8", 
    "Purpose": "Students must be able to reason, problem solve, communicate and make real life       decisions that require mathematical thinking.  Teaching students problem solving skills and giving them opportunities to apply their skills is critical to developing their capacity to solve mathematical problems that arise in all our lives (e.g. starting a small business, figuring out the area of a room in order to purchase the correct amount of paint, filling out a tax return, tracking and setting goals for investments, etc.)", 
    "IP":"Problem of the Week(PoW)", 
    "What": "PoWs are omplex problems that students solve and then explain their solutions and reasoning in a write up.  More weight should be given to mathematical thinking and a good write up than finding the correct solution.",
    "When": "PoWs should be administered once per month.  Students should work on problem the first 10-15 minutes of a period for 5-7 consecutive days.", 
    "How": "1.Introduce problem, process, and rubric. 2.Students are given time in class to work on problem throughout the week. 3.Students complete write up. 4.Student peer edit write up. 5.Students revise write up"
  },

  {
    "IG":"Problem Solving", 
    "AIR_Indicators": "All Domain 1 Indicators* 3.1, 3.2, 3.3,     3.4", 
    "SMP": "SMP 1, 2, 3, 4, 5, 6, 7, and 8", 
    "Purpose": "Students must be able to reason, problem solve, communicate and make real life       decisions that require mathematical thinking.  Teaching students problem solving skills and giving them opportunities to apply their skills is critical to developing their capacity to solve mathematical problems that arise in all our lives (e.g. starting a small business, figuring out the area of a room in order to purchase the correct amount of paint, filling out a tax return, tracking and setting goals for investments, etc.)", 
    "IP":"Problem of the Week(PoW)", 
    "What": "PoWs are omplex problems that students solve and then explain their solutions and reasoning in a write up.  More weight should be given to mathematical thinking and a good write up than finding the correct solution.",
    "When": "PoWs should be administered once per month.  Students should work on problem the first 10-15 minutes of a period for 5-7 consecutive days.", 
    "How": "1.Introduce problem, process, and rubric. 2.Students are given time in class to work on problem throughout the week. 3.Students complete write up. 4.Student peer edit write up. 5.Students revise write up"
  }

]

$('body').append(template(igListOrig));

如何使用Handlebar帮助器在igListOrig.[0].How标签中打印<ul><li>

这是我想要放置的html

<div class="bottom-container text">
    <div class="cube">
      <h4>Instructional Practice</h4>
      <center><h3> {{IP}} </h3> </center> </br>
      <p><span class="description">What</span> {{What}} </p></br>
      <p><span class="description">When</span> {{When}} </p></br>
      <p><span class="description">How</span> {{How}} </p></br>
    </div>
</div>

查看JS小提琴,获取完整示例http://jsfiddle.net/rr9Vz/

0 个答案:

没有答案