Folks, this post has nothing to do with CSS.
$('someID') as a
document.getElementById replacement so I can use the dollar signs like the big boy libraries.
But when a project demands some special effects (like moo.fx or scriptaculous), I thought I could just pull in my favorite library and slide, grow, shrink, whatever, without any hiccups. Not so. I found jquery, and tried to plug it in and use alongside my existing scripts. That’s when I noticed some “getElementsByTagName is not a function” errors.
It turns out that my use of
$('someID') was the culprit. jquery’s use of the dollar sign is much more involved than EJ’s, and it was causing some hiccups. So I changed the EJ “library” to use
getId('someID') instead of the
$. Now it’s still more efficient (at least as far as me typing it out) than using
document.getElementById, and I get the benefits of using jquery where I need it, too, with no more conflicts (yet).
As I grow more familiar with jquery, I look forward to making better use of it, and eventually exclusive use of it. In the meantime, I’m attempting to get the best of both worlds – a powerful library that I don’t understand vs. a less efficient library that I “get” (no offense to Robert Nyman about the efficiency remark).