CareerFruits » javascript http://careerfruits.com power of thoughts... Fri, 02 Apr 2010 03:36:20 +0000 http://wordpress.org/?v=2.9.2 en hourly 1 Unobtrusive JavaScript – What is it? http://careerfruits.com/2009/10/24/unobtrusive-javascript-what-is-it/ http://careerfruits.com/2009/10/24/unobtrusive-javascript-what-is-it/#comments Sat, 24 Oct 2009 07:00:03 +0000 admin http://careerfruits.com/?p=8 I came across this concept while reading “JQuery in Action”. I am on chapter 1 and the language and explanations given are excellent. (i.e. one can easily understand)

My understanding for it is:

It is a way to separate the behavior from the structure. Instead of clubbing the event behavior within HTML tags, we can use JQuery selectors to select the HTML element and apply the event behavior through script.

According to the principles of  Unobtrusive JavaScript:

“Any JavaScript expressions or statements embedded in the <body> of
HTML pages, either as attributes of HTML elements (such as onclick) or in script
blocks placed within the body of the page, are considered as correct.”

 

Unobtrusive JavaScript, though a powerful technique to further add to the
clear separation of responsibilities within a web application, doesn’t come without
its price. Unobtrusive JavaScript not only may increase the amount of script that needs to be written, but also requires some discipline and the application of good coding patterns to the client-side script.

]]>
http://careerfruits.com/2009/10/24/unobtrusive-javascript-what-is-it/feed/ 6