V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
582033
V2EX  ›  问与答

关于backbonejs问题

  •  
  •   582033 · 2013-09-04 16:20:08 +08:00 · 2275 次点击
    这是一个创建于 3901 天前的主题,其中的信息可能已经有所发展或是发生改变。
    一开始就遇到问题了,严重受打击中.

    求JSer帮忙看看.

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

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

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

    (function ($){
    $(function(){
    // do something
    });
    })(jQuery)
    582033
        7
    582033  
    OP
       2013-09-04 17:06:35 +08:00
    @judasnow @airyland 好使,谢谢
    andy12530
        8
    andy12530  
       2013-09-04 20:27:22 +08:00
    jquery没玩熟悉,折腾backbone不会觉得吃力么。。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   997 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:28 · PVG 04:28 · LAX 13:28 · JFK 16:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.