JSFiddle - React, Tailwind, and code Playground
by kmiklas
HTML
<script src="http://www.sexydevelopment.com/keith/canjs1/js/can.jquery.js"></script>
<a id="hello-planet" href="#">hello, planet (jQuery event listener)</a>
<br><br>
<a id="hello-earth" href="#">hello, earth (canjs event listener)</a>
JavaScript
$(document).ready( function documentReady() {
$('a#hello-planet').on( 'click' , function jQueryClick(e) {
e.preventDefault();
alert('hello, planet!\n\njQuery .on() Event Listener');
});
var CanjsEventListener = can.Control({
'init': function() { $.noop(); },
'click': function canjsClick(link, event) { alert('hello, earth\n\ncanjs Event Listener'); }
});
var canjsEventListenerInstance = new CanjsEventListener('#hello-earth', {});
console.log('Hello planet click event:');
console.log($._data($('#hello-planet')[0], 'events'));
console.log('\n');
console.log('Hello earth click event:');
console.log($._data($('#hello-earth')[0], 'events'));
});