V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
liveme
V2EX  ›  程序员

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

  •  
  •   liveme · Jul 30, 2013 · 3408 views
    This topic created in 4654 days ago, the information mentioned may be changed or developed.
    使用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”。是我弄错哪里了么?百思不得其解。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   992 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 22:17 · PVG 06:17 · LAX 15:17 · JFK 18:17
    ♥ Do have faith in what you're doing.