Home arrow JavaScript arrow Introducing the Behaviour JavaScript Library

Introducing the Behaviour JavaScript Library

Separating the layers of your web pages makes them more compact and easier to maintain. The Behaviour JavaScript library makes it easy for even beginning coders to do this, and helps seasoned developers save time when building web sites. This article is the first in a three-part series that explains the features of this library.

Author Info:
By: Alejandro Gervasio
Rating: 4 stars4 stars4 stars4 stars4 stars / 12
March 19, 2007
  1. · Introducing the Behaviour JavaScript Library
  2. · A basic example
  3. · Expanding the application range of the Behavior package
  4. · Applying rules to a different CSS selector

print this article

Introducing the Behaviour JavaScript Library
(Page 1 of 4 )

To speak frankly, the Web still contains thousands of web sites that have been poorly developed. Many of them include amateur graphics, implement limited or nonexistent accessibility and usability, and so forth. This becomes even more evident when you take a quick look at their rendered source code.

One of the most critical issues of these web sites is the way that JavaScript code is integrated into the corresponding structural markup. Examining the client-side code of this kind of web site can be a painful experience. There are many messy, inline JavaScript handlers here and there, mixed up with (X)HTML code. And then of course, there is the weak structure of the markup in question. All of these factors speak for themselves about how poorly the pages have been created and designed.

On today's Web the above scenario seems to be unfortunately quite popular. But if you're a conscientious web developer, then you know the importance of building web sites where each one of the layers -- that is, the sections corresponding to visual presentation, behavior and structure respectively -- are completely isolated from each other. This is the best approach to take to keep these web sites compact and highly maintainable.

However, you may be a beginner that still mixes up inline JavaScript event handlers with the structural markup of your web sites, simply because you don't know that these two classes of elements should reside in different layers. So, bearing in mind this eventual possibility, in this three-part series I'm going to show you how to avoid including the aforementioned inline JavaScript handlers by using a compact, tight JavaScript library called "Behaviour."

The Behaviour package has been created by Ben Nolan (please visit http://www.bennolan.com/behaviour/ for more information). It boasts a bunch of remarkable features which will let you separate the (X)HTML and JavaScript code corresponding to your web site very easily. It's particularly useful when it comes to assigning event handlers to one or more elements of different web documents.

Having introduced the main characteristics that this powerful JavaScript package offers, now let's move on and start learning together how to take advantage of its numerous and handy features. Let's begin now!

blog comments powered by Disqus

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials