简单记一下我所做项目中用到的代码,以备以后用的时候一看明白了。
1.jsp(jquery-jtemplates.js下载地址:http://download.csdn.net/detail/xlb744868186/8508141)
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-jtemplates.js"></script> <%@ include file="wayBillStatusRcvTpl.html"%> // 订单申报回执历史 function findRcvDtl(id){ $.getJSON(eTrade.ctx + "/tradeinfo/export/waybillstatus/findRcvDtl.do",{"id":id}, function(data){ if(data){ $("#rcvListDiv").setTemplateElement("rcvTpl").processTemplate(data); $("#rcvListDiv").dialog({ title : "运单状态订单回执", width : 720 }); } }); } <div id="rcvListDiv"></div>
2.html
<%@ page contentType="text/html; charset=UTF-8" %> <textarea id="rcvTpl" style="display: none"> <table class="tableborder" style="margin-top: 5px;"> <thead> <tr> <td class="tdcenter"><span>guid</span></td> <td class="tdcenter"><span>运单号</span></td> <td class="tdcenter"><span>返回状态</span></td> <td class="tdcenter"><span>返回时间</span></td> <td class="tdcenter"><span>返回信息</span></td> </tr> </thead> <tbody> {#foreach $T as rcv} <tr> <td class="tdright">{$T.rcv.guid}</td> <td class="tdright">{$T.rcv.logisticsNo}</td> <td class="tdright">{$T.rcv.returnStatus}</td> <td class="tdright">{$T.rcv.returnTime}</td> <td class="tdright">{$T.rcv.returnInfo}</td> </tr> {#/for} </tbody> </table> </textarea>
时间: 2024-10-11 07:28:22