Java Reference
In-Depth Information
1
Introduction to JavaScript
and the Web
In this introductory chapter, you look at what JavaScript is, what it can do for you, and what you
need in order to use it. With these foundations in place, you will see throughout the rest of the
topic how JavaScript can help you to create powerful web applications for your web site.
The easiest way to learn something is by actually doing it, so throughout the topic you'll create a
number of useful example programs using JavaScript. This process starts in this chapter, by the
end of which you will have created your fi rst piece of JavaScript code.
Introduction to JavaScript
In this section you take a brief look at what JavaScript is, where it came from, how it works, and
what sorts of useful things you can do with it.
What Is JavaScript?
Having bought this topic, you are probably already well aware that JavaScript is some sort of com-
puter language , but what is a computer language? Put simply, a computer language is a series of
instructions that tell the computer to do something. That something can be one of a wide variety
of things, including displaying text, moving an image, or asking the user for information. Normally,
the instructions, or what is termed code , are processed from the top line downward. This simply
means that the computer looks at the code you've written, works out what action you want taken,
and then takes that action. The act of processing the code is called running or executing it.
In natural English, here are instructions, or code, you might write to make a cup of instant coffee:
1.
Put coffee crystals in cup.
2.
Fill kettle with water.
Search WWH ::




Custom Search