Take Up Your Cross-browser Scripting Digg this entry Add this entry to del.icio.us bookmarks Add this entry to Slashdot bookmarks

I wrote this over a year ago, and have been too reluctant (embarrassed?) to release it. I was going to delete it, and found that I was too weak-willed. So my character flaws have trapped me -- I'm unleashing this on the world so I don't have to think about it anymore. Sorry.

Javascript Enhancement Suppression through the Use of Self-restraint

Chances are, you've been to more than a few websites proudly proclaiming their Web 2.0 status. You have visited message boards or seen mailing lists full of new users interested in AJAX. And you may have begun to realize that the number of aspiring web professionals who merely ask "How do I...?" vastly outnumbers those who also ask "How should I...?" or even "When should I...?". Whether or not you understand and use concepts like graceful degradation or progressive enhancement, this page is for you.

Do you know JESUS?

If you are guilty of any of these sins, it's likely that you need to come to JESUS:

  • Your page technically works, thanks to a javascript framework you found, but you notice more than a few console errors that you have no clue how to fix.
  • You make it clearly known to your users that your site uses AJAX. Bonus points if your intended audience, in all likelihood, doesn't know what AJAX is.
  • You defile your <body> by inserting <script> tags into it.
  • You often write complex scripts that duplicate behaviors already available through the use of HTML (eg. the tabindex attribute or the submit button).
  • You have recently placed an onclick handler attribute within an anchor tag.

What would JESUS do?

JESUS saves client-side CPU cycles, saves bandwidth, saves page load time, saves your alternate-browser visitors frustration, and may save you from embarrassment among your peers when Web 2.0 fully reveals itself as DHTML 2.0 (though it may be too late for that).

But I'm not worthy!

JESUS accepts you wherever you are. If you're just starting to learn web design and scripting, now is the best time to follow. Reference sites like Quirksmode and Adactio will help to get you started. Books like DOM Scripting by Jeremy Keith are also good references.

If you're a seasoned developer and you don't follow JESUS, it's never too late! Repent by taking advice from Robert Nyman and Bobby van der Sluis to heart. You may even find a book like ppk on Javascript to be a Godsend.

1 CommentRSS

1 Anonymous wrote: [7:59am on December 7 2008]

I think you could've worked a prototype joke in there, but I loled anyway. Accessibility and amen.

Comments are disabled for this entry.