582033
V2EX  ›  问与答

关于backbonejs问题

  •  
  •   582033 · Sep 4, 2013 · 2751 views
    This topic created in 4635 days ago, the information mentioned may be changed or developed.
    一开始就遇到问题了,严重受打击中.

    求JSer帮忙看看.

    页面: http://582033.vicp.net/other/backbone.html

    JS: http://582033.vicp.net/other/js/test.js

    alert死活不出来.
    8 replies    1970-01-01 08:00:00 +08:00
    582033
        1
    582033  
    OP
       Sep 4, 2013
    等待援助中..
    judasnow
        2
    judasnow  
       Sep 4, 2013
    加个 el : "#wall" 试试?
    582033
        3
    582033  
    OP
       Sep 4, 2013
    @judasnow 是这么加么?貌似还不好使?
    judasnow
        4
    judasnow  
       Sep 4, 2013
    js 放到最后试试
    judasnow
        5
    judasnow  
       Sep 4, 2013
    放到 body 外面 html 前面,js 运行的时候 dom 还没有生成。
    airyland
        6
    airyland  
       Sep 4, 2013
    执行时DOM未生成,把代码放到document.ready后:

    (function ($){
    $(function(){
    // do something
    });
    })(jQuery)
    582033
        7
    582033  
    OP
       Sep 4, 2013
    @judasnow @airyland 好使,谢谢
    andy12530
        8
    andy12530  
       Sep 4, 2013
    jquery没玩熟悉,折腾backbone不会觉得吃力么。。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   905 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 20:58 · PVG 04:58 · LAX 13:58 · JFK 16:58
    ♥ Do have faith in what you're doing.