> FWIW, adding an onclick is not the preferred way of doing this. It's better
>> to attach events to anchors during document.onload event. If anchors need to
>> be filtered, dom/css classes can be used.
>
>
> Sounds interesting, care to share a little more about this method?
>
>
There are some good Javascript APIs out there for providing interesting,
cross-browser functionality. Prototype (prototypejs.org), jQuery and YUI are
popular ones I can think of. Under jQuery you would have:
$('a.outlink).click(function() { ... }

which finds anchors with class name outlink and attaches an onclick event
thus abstracting a lot of the JS tediousness. I actually managed to write up
a pretty cool Web 2.0 Scrabble game while exploring Prototype.js
http://aleembawany.com/yabble/

Google for jQuery or Prototype getting started tutorials. You should be
looking to do away with any and all JS in your markup just like you would do
with CSS.

Reply via email to