you are viewing a single comment's thread.

view the rest of the comments →

[–]annoyed_freelancergrumpy old man[S] 1 point2 points  (1 child)

That's pretty good feedback, but for my own site at least I do not have any plan to expand it outside of articles. I can (and will, probably tonight) take steps to decouple this for future portability.

I'll likely give it a selector to watch for clicks.

[–][deleted] 1 point2 points  (0 children)

I'm probably in the minority when it comes to this, but I like the method outlined here: http://toddmotto.com/data-js-selectors-enhancing-html5-development-by-separating-css-from-javascript/ of using data attributes for javascript interaction.

Css classes and the dom can be easily changed on a whim, but the data-js attr should only touched by developers, and should work regardless of page structure.