• 请不要在回答技术问题时复制粘贴 AI 生成的内容
gaody
V2EX  ›  程序员

一想到要将json拼凑成又长又复杂的html我就窝火

  •  
  •   gaody · Jun 9, 2013 · 6364 views
    This topic created in 4902 days ago, the information mentioned may be changed or developed.
    搜索了一下有个jquery tmpl插件可是似乎不再支持了

    有不想用js 拼凑字符串

    有什么好方法吗?
    25 replies  •  1970-01-01 08:00:00 +08:00
    jerry
    jerry
    Jun 9, 2013 via iPad❤️1
    2
    refresh
    refresh
    Jun 9, 2013
    3
    还有handlebars等等一堆的模板引擎,或者用jQuery与underscore的template
    gDD
    gDD
    Jun 9, 2013 via Android❤️1
    4
    doT.js很不错!
    maddot
    maddot
    Jun 9, 2013
    5
    在服务器端生成html片段也是一个方法吧
    lyric
    lyric
    Jun 9, 2013❤️3
    6
    这种时候不推荐 http://angularjs.org/ 是不科学的。这才是最好的模版。
    explon
    explon
    Jun 9, 2013 via iPhone❤️1
    7
    hogan
    greatghoul
    greatghoul
    Jun 9, 2013
    8
    mustache +1
    coffee +1
    angularjs +1
    fiture
    fiture
    Jun 9, 2013
    9
    你不知道有模板么?
    fiture
    fiture
    Jun 9, 2013
    10
    @fiture 模板引擎。
    lerry
    lerry
    Jun 9, 2013
    11
    试试这个,
    https://github.com/leonidas/transparency
    前一段在hacker news上还看到一个,想不起来名字了,应该是这个
    gaody
    gaody
    OP
    Jun 9, 2013
    12
    @maddot 显然没有返回json节省资源,而且服务器端也要拼凑啊,当然服务器端简单点

    @jerry 在看

    @refresh jquery的template 不支持了吧

    @gDD doT.js好像很直观的样子
    unstop
    unstop
    Jun 9, 2013
    13
    @lerry 别用这个,我之前在项目里面用过这个,很难用,很难维护,最后不得不换,现在切换成了 http://aui.github.io/artTemplate/ 还算可以。
    Paranoid
    Paranoid
    Jun 9, 2013
    14
    AngularJS 服务端json, 客户端数据绑定,自动更新template。
    Sivan
    Sivan
    Jun 10, 2013
    15
    handlebars.js
    zhujinliang
    zhujinliang
    Jun 10, 2013
    16
    我们这的哥们一行一行document.write都写了,楼主这算啥。。。
    catfan
    catfan
    PRO
    Jun 10, 2013
    17
    alexrezit
    alexrezit
    Jun 10, 2013
    18
    @lyric
    看你越来越像搞传销的了... =.=
    lyric
    lyric
    Jun 10, 2013
    19
    @alexrezit 看错了不是,我这不符合传销的性质,而且其实本质上传销没啥不好的
    magic22cn
    magic22cn
    Jun 11, 2013
    20
    js模板怎么应对搜索引擎?
    ehaagwlke
    ehaagwlke
    Jun 12, 2013
    21
    用AngularJS吧,再好用不过了。
    xiangheka
    xiangheka
    Jun 12, 2013
    22
    jqote2 和jtemplate类似
    raptor
    raptor
    Jun 13, 2013
    23
    jquery的template好像已经被废了。我只用underscore,貌似还可以。
    juicy
    juicy
    Jun 13, 2013
    24
    jquery的template只是不再在官网推荐了吧,github上还是有那个项目的,想用还是可以用的~~
    jackhe
    jackhe
    Jun 13, 2013
    25
    jsrender
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2319 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 13:05 · PVG 21:05 · LAX 05:05 · JFK 08:05
    ♥ Do have faith in what you're doing.