Sunday, October 4, 2009

What is Javascript and what can it do?

http://computer.howstuffworks.com/question369.htm

http://www.youtube.com/watch?v=2t3ZysHg3Cc

(silent, but good)


JavaScript is what is called a Client-side Scripting Language. That means that it is a computer programming language that runs inside an Internet browser (a browser is also known as a Web client because it connects to a Web server to download pages).

The way JavaScript works is interesting. Inside a normal Web page you place some JavaScript code (See How Web Pages Work for details on Web pages). When the browser loads the page, the browser has a built-in interpreter that reads the JavaScript code it finds in the page and runs it.

Web page designers use JavaScript in many different ways. One of the most common is to do field validation in a form. Many Web sites gather information from users in online forms, and JavaScript can help validate entries. For example, the programmer might validate that a person's age entered into a form falls between 1 and 120.

Another way that web page designers use JavaScript is to create calculators. Here are several examples:

RPN calculator
MegaConverter - a big collection of calculators
Personal Finance calculators
To give you an example of an extremely simple JavaScript calculator, the HTML below shows you how to create a Fahrenheit to Celsius converter using JavaScript: