HTML and CSS Reference
In-Depth Information
The next figure shows the key details of the Firefox console. Most of
the screenshots in the following sections were taken using Firefox.
Firefox Console
Output appears
after an arrow
pointing right.
Your input appears
alongside arrows
pointing left.
Errors are indicated
by an x.
Other browsers
Several other browsers ought to work equally well. Here's how you get
to the console in them:
Internet Explorer Press F12 , or look for developer tools in the Page
menu.
Opera —Right-click the page, and choose Inspect Element from the
context menu.
Firefox with Firebug Press F12 , or right-click and select Inspect with
Firebug from the context menu.
Now that you know how to execute JavaScript in your browser of choice,
it's time to start learning some JavaScript. You'll begin with arithmetic
and storing the results. Over a few short pages, these simple operations
will build up to programs that can do useful things in your web pages.
Arithmetic and variables
A computer program is based on math. It boils down to a sequence of
mathematical operations on a collection of numbers. If you've always
been bad at math, don't let this frighten you: programming—the act of
composing a program—has as much in common with writing a story as
it does with solving math problems (albeit a story written with unusu-
ally strict grammar and far more punctuation then you're used to).
Think of it as an obscure subgenre of science fiction. But the simplest
Search WWH ::




Custom Search