Inline handlers are deprecated as of XHTML Strict

To avoid the use of inline JavaScript events, I was seeking an event handler to gather event bubbling and provide an alternative to the deprecated target="_blank".

I think this website, evotech.net sums up everything I needed.

Using CDATA Instead of Comments
Properly enclosing script contents inside of CDATA sections can cause problems in downlevel browsers which do not understand XML. However, it is possible to combine JavaScript Comments with CDATA sections to allow for backward compatibility.
< script type="text/javascript" >
//< ![CDATA[
var i = 0;

while (++i < 10)
{
// ...
}
//]] >
< /script >

Further reading:

Separating behavior and structure

New-Window Links in a Standards-Compliant World [WARNING: annoying pop-ups inhabit this page]

Using JavaScript instead of target to open new windows

A List Apart

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • description
  • ThisNext
  • MisterWong
  • Wists

Leave a Reply

You must be logged in to post a comment.