CanJS jQuery Template
Includes jQuery, CanJS and all of its plugins. Use it as a starting point when you want to demo something.
HTML
<script src="http://canjs.com/release/1.1.6/can.jquery.js"></script>
<script src="http://canjs.com/release/1.1.6/can.view.mustache.js"></script>
text outside text outside text outside text outside
<div id="container">
There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here <div id="some-clickable-element"> This is a clickable element</div> <a id="some-clickable-link" href="#"> This is a clickable link</a> There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here There is a lot of static text here hmm
</div>
text outside text outside text outside text outside text outside
CSS
body { font: 16px Arial, sans-serif;}
JavaScript
function handleClick(ev) {
console.log("container's click handler invoked", arguments, ev.target, ev.target.tagName.toLowerCase());
if (ev.target.tagName.toLowerCase() === "a") {
$("body").prepend("ha ");
}
ev.preventDefault();
}
$("#container").on("click", handleClick);