Introduction to JavaScript
JavaScript is not Java!
Except for the rather confusing similarity in names, JavaScript is completely unrelated to the Java language and they have almost nothing in common.JavaScript is a computer scripting language used to add functionality to web pages.
JavaScript is a client-side language, meaning that the code is downloaded as part of the web page and executed on the end users' computer. This is in contrast to server-side languages (such as PHP and Perl) which run completely on the server and send only the finished output to the end user.
What Can JavaScript Do?
JavaScript can turn a web page from a passive experience (where the viewer simply looks at the page) to an interactive page offering dynamic content.
Some common examples of JavaScript in use include:
- Displaying information based on user input
- Displaying the current date and time
- Checking details entered into a form to make sure they meet certain criteria
- Playing games
- Adding special effects such as moving backgrounds, changing colours, custom cursors, etc.
Should I Use JavaScript?
This question is often debated passionately in web design circles. JavaScript has its share of supporters and detractors and some of them can be quite pushy. Newsgroups and discussions forums can also contain lot of distorted information so be careful when listening to the varying opinions.
In our opinion JavaScript is a good language and a good choice for general website applications. As long as you are aware of the pros and cons of JavaScript, and you have reason to believe JavaScript can do the job you need, it's really just a matter of personal preference.