Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在流星中使用此功能?例如,我希望能够点击任何给定的
元素并找出它的类是什么。另外,我怎样才能获得关于我用 Meteor 点击的项目的信息?
假设在代码中的某处您有一个模板处理事件:
Template.tmpl_name.events = { 'click #logo': function (e) { // Instead of using $(this), you can do: var $this = $(e.target); // Your usual code here, e.g.: console.log($this.attr('href')); } };