1
sd4399340 OP 我把模板块放到script里了,一切正常了,世界清静了。。。
|
2
darcy 2012 年 4 月 25 日
我的做法是放在script或者textarea里,以避免img等产生请求。
|
3
jjlovegrape 2012 年 4 月 25 日
<script id="XXX" type="text/template">你的HTML内容</script>
另外,我建议用函数的方式获取值,可以进行一些数据校验,这样会比较健壮。 例如:{{someFunc}} json.someFunc = function(){ 处理你的逻辑; return someValue; }; |
4
sd4399340 OP @jjlovegrape 需要处理的数据我才这样做,每个获取的都wrap个函数岂不是挺麻烦的~
|
5
jjlovegrape 2012 年 4 月 26 日
@sd4399340 用getter(),setter()的方式比直接访问attribute更合理。
|