Javascript debabbled
I've spent the last couple of weeks talking about Java and its big brother J2EE, so this week it only makes sense to introduce Java's very popular (but somewhat distant) cousin, Javascript.What is Javascript?
I should point out that, technically speaking, Javascript is not directly related to Java. Javascript was created by Netscape (with Sun's blessing) for use in its early web browsers. The two languages share some common heritage and have a similar look and feel ("syntax", in geek-speak), but were developed independently.
I've talked a bit about server-side scripting, which is code that runs on the server before a web page is created. Javascript is an example of the opposite approach, known as client-side scripting. Client-side scripts are programs that run directly on the web browser (the "client" being your computer). For example, if you move your cursor over the buttons at the top of this page, they change appearance. That feature (usually caled an "image rollover") was created with Javascript, as it requires the web page to interact with your computer (input from your mouse, in this case) and respond in real time.
What's in it for me?
The plus of Javascript is that client-side scripts can run on web pages that have already been loaded, allowing them to interact with the visitor. You've probably seen many examples of Javascript at work, including image rollovers for navigation buttons, pop-up messages, and form validation. Javascript is by far the most popular client-side scripting language and is very well supported. Unfortunately, the trick of client-side programming is that Javascript isn't supported in exactly the same way by all browsers. More complex scripts can be very difficult to program and need a significant amount of testing. On the other hand, if you're just looking for some common bells and whistles, you can find many samples and tutorials online, and even non-programmers can effectively put Javascript to use.


