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

js模板过于集中的问题

  •  
  •   leeyupeng · Oct 21, 2011 · 8844 views
    This topic created in 5336 days ago, the information mentioned may be changed or developed.
    最近在用backbone改一个后台管理(web端用的django),结果导致很多的js模板,类似<script type="text/template" id="xxx">之类的都放到了同一个.html里,但对于每个不同的router来说,不是所有的模板都需要,这样页面加载完后其实多了很多无用的js模板。

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

    放HTML里看着不舒服的话, 扔JS里压掉就不碍眼了...
    panlilu
        4
    panlilu  
       Oct 22, 2011
    有没有不需要django的类似的包管理库?
    AntiGameZ
        5
    AntiGameZ  
       Oct 22, 2011
    @panlilu ender?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3766 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 96821589 · 40ms · UTC 04:33 · PVG 12:33 · LAX 21:33 · JFK 00:33
    ♥ Do have faith in what you're doing.