假设我有以下标记
<ul class="app-nav">
<li><a href="#!/testing">Link to testing route</a>
</ul>
...
<a href="#!/testing">Other link to testing route</a>
使用 jQuery
$('a').click(function() {
console.log( $(this) ); //the event sender and can be 'a' or 'ul>li>a'
});
使用 sammy.js
this.get('#!/testing', function(context) {
//how I can get the event sender?
});