template.helper('changeTime',function getLocalTime(nS) { var b=nS.substr(6,13); var c=parseInt(b) var d = new Date(c); return d.Format('yyyy-MM-dd hh:mm');}); template.helper('toDate',function (dt) { if(dt){ if(getExplorerInfo().type=="Chrome"){…
Function Function is composed of name, parameter (operand, type of operand), return value, body with another adornment like: inline, virtual, static, const, throw(). 我们必须在调用函数之前,就声明该函数否则会引起编译错误. 函数声明由函数返回类型,函数名和参数表构成. 这三个元素被称为函数声明function declaration…
原生语法 使用原生语法,需要导入template-native.js文件. 在HTML中定义模板,注意模板的位置,不要放到被渲染区域,防止模板丢失. <script id="main_panel_big_sale_template" type="text/html"> <% for (var i = 0; i < products.length; i ++) { %> <% var product =products[i]; %&…