Home arrow JavaScript arrow Introducing the Behaviour JavaScript Library
JAVASCRIPT

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 / 9
March 19, 2007
TABLE OF CONTENTS:
  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
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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