For some time now I’ve been meaning to write about jQuery, an increasingly popular JavaScript framework. There are a number of JavaScript frameworks available, all with their own strengths and weaknesses, so I don’t want to suggest that jQuery is the best one, but it does have its advantages. In particular, I like:
- that there’s only one file to include in a page
- how simple DOM (Document Object Model) references are, as manipulating the DOM is such a large part of Rich Internet Applications
- the unobtrusive JavaScript approach
If you’re not familiar with this last concept, it involves keeping the JavaScript together, in the page’s HEAD, separate from the HTML. Pretty much anytime you separate X from Y (data from presentation, HTML from PHP, CSS markup from HTML, etc.), it’s a good thing. At the very least, abiding by unobtrusive JavaScript makes editing JavaScript easier. (There’s more to unobtrusive JavaScript than just this but…)
In this first post on jQuery, I’ll just discuss how to prepare a page to use jQuery. Over the next few days, subsequent posts will demonstrate more complex applications of jQuery. Continue Reading…