582033
V2EX  ›  问与答

关于backbonejs问题

  •  
  •   582033 · Sep 4, 2013 · 3093 views
    This topic created in 4822 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
    582033
    OP
    Sep 4, 2013
    1
    等待援助中..
    judasnow
    judasnow
    Sep 4, 2013
    2
    加个 el : "#wall" 试试?
    582033
    582033
    OP
    Sep 4, 2013
    3
    @judasnow 是这么加么?貌似还不好使?
    judasnow
    judasnow
    Sep 4, 2013
    4
    js 放到最后试试
    judasnow
    judasnow
    Sep 4, 2013
    5
    放到 body 外面 html 前面,js 运行的时候 dom 还没有生成。
    airyland
    airyland
    Sep 4, 2013
    6
    执行时DOM未生成,把代码放到document.ready后:

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