JavaScript: Woolly Beast

6/28/2010 12:00 AM By

JavaScript is a wild and woolly beast to contend with at times, but it can be tamed. We’ll be going through some JavaScript tricks and techniques to make life easier on your website development jobs. Let’s make sure we’ve got some basics down.

First of all, what is JavaScript? As its name implies, it’s a scripting language, but the “Java” portion of its name is only there because it was designed to look like Java. They’re both object-oriented and their syntax is based on C, but there’s no other relationship between the two languages.

As far as the execution of your JavaScript (hereafter referred to as JS), it should be noted that the DOM of each browser reacts differently to JS. As such, a great many compatibility concerns come up when attempting to write JS that plays nicely on all the major browsers. Thankfully, there are tools help with this process.

Lastly, while writing your own JS is not only advisable, but encouraged in order to better understand the language, it should be noted that there are dozens of libraries out there that have already been built up, are actively maintained, and likely do what you’re looking to do. A few of the better known of these are jQuery, YUI, Prototype, and Moo Tools. You can take a look at a more complete list (complete with links) at javascriptlibraries.com.

When deciding to pursue a project, a single library should be used; mixing and matching libraries can have decidedly tricky results. So, with that in mind, for the purposes of the examples that will be presented here, we’ll be utilizing the jQuery library almost exclusively.

Comments are closed.