V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
liveme
V2EX  ›  程序员

qatrix.js中事件委托的一个怪异现象,求解

  •  
  •   liveme · 2013-07-30 11:04:14 +08:00 · 2609 次点击
    这是一个创建于 3961 天前的主题,其中的信息可能已经有所发展或是发生改变。
    使用qatrix.js的事件委托时发现在本地测试能正常获取到event.target,但是上传到服务器就不能正常获取到event.target了。

    $ready(function (){
    var switch_handler = function(even){
    var switch_target = event.target;
    console.log(switch_target.id);
    }
    $event.on($("wrapper"), "click", switch_handler);
    });

    如上代码,在本地能正常获取到switch_target.id,但是上传到服务器后发现每次获取到的switch_target.id都是“wrapper”。是我弄错哪里了么?百思不得其解。
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1567 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:07 · PVG 01:07 · LAX 10:07 · JFK 13:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.