代码改变世界

前段技巧

2017-07-25 16:11  hl_流星  阅读(154)  评论(0编辑  收藏  举报

modls中 choice   前段row.get_xx_display显示choice的key

 

前段自定format函数

String.prototype.Format=function (arg) {
var temp=this.replace(/\{(\w+)\}/g,function (k,kk) {
return arg[kk];
})
return temp
};
注:/g的作用是完全匹配