V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
leeyupeng
V2EX  ›  Backbone.js

js模板过于集中的问题

  •  
  •   leeyupeng · 2011-10-21 19:14:45 +08:00 · 7631 次点击
    这是一个创建于 4542 天前的主题,其中的信息可能已经有所发展或是发生改变。
    最近在用backbone改一个后台管理(web端用的django),结果导致很多的js模板,类似<script type="text/template" id="xxx">之类的都放到了同一个.html里,但对于每个不同的router来说,不是所有的模板都需要,这样页面加载完后其实多了很多无用的js模板。

    不知道这是不是单页应用的固有问题,还是说有别的解决方法?
    5 条回复    1970-01-01 08:00:00 +08:00
    stranbird
        1
    stranbird  
       2011-10-21 19:43:49 +08:00
    看看Jammit
    leeyupeng
        2
    leeyupeng  
    OP
       2011-10-21 19:56:35 +08:00
    @stranbird 多谢!!!根据你的提示我找到了这个: https://github.com/marlun/django-djammit
    lainuo
        3
    lainuo  
       2011-10-22 10:37:04 +08:00
    没办法吧...Jammit好像是用来管理打包的吧...

    放HTML里看着不舒服的话, 扔JS里压掉就不碍眼了...
    panlilu
        4
    panlilu  
       2011-10-22 12:56:25 +08:00
    有没有不需要django的类似的包管理库?
    AntiGameZ
        5
    AntiGameZ  
       2011-10-22 12:57:32 +08:00
    @panlilu ender?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2646 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 15:49 · PVG 23:49 · LAX 08:49 · JFK 11:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.