22 Mar '12, 1pm

Slightly Obtrusive JavaScript:

→ Slightly Obtrusive JavaScript 31 May 2010 There are good things and bad things about "Unobtrustive JavaScript." One bad thing: it's hard to tell what JavaScript is touching an element. Idea: Only ever use classes and ids prefix with js- when touching the DOM with JavaScript. For example: <a href="#prices class="js-open-tab">Prices</a> Now we know to look for any JavaScript touching .js-open-tab , which should only be a simple search away. And hey, now JavaScript and CSS won't share selectors. Since we're separating our content and presentation, we might as well separate our behavior all the way too. We could also use FireQuery , though it only works with one JavaScript library in one browser, and not with $.fn.live() . Though I do love it.

Full article: http://ozmm.org/posts/slightly_obtrusive_javascript.html


Javascript templates using eco.

rubyflow.com 21 Mar '12, 12am

Javascript templates using eco. Posted by stjhimy on March 21, 2012 — 0 comments Eco makes coffeescript available on javas...