John O'Donovan has now blogged about this
 
http://www.bbc.co.uk/blogs/bbcinternet/2008/11/knowing_when_to_go_1.html

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Aleem B
Sent: 05 November 2008 12:22
To: backstage@lists.bbc.co.uk
Subject: Re: [backstage] "Greedy BBC Blocks External Links"




                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