Understanding the Conventions and Icons

This book is about programming. You can’t learn to program without a way to see what a particular program does when a computer processes it. Setting up a mechanism for observing what a program does is sometimes called creating a test bed.

In this case, the test bed consists of Hypertext Markup Language (HTML), or Web pages, that contain JavaScript code. You then open the Web pages in a browser. There also has to be a mechanism for starting the program, but you’ll see that later in this chapter.

To conceptually separate the HTML (which isn’t programming code) from the JavaScript (which is), this book will use all upper-case letters for HTML most of the time. For example (not worrying for the moment what these things mean), the following code contains HTML:

 <BODY>  var month_income = new Array(12); 

In this example, < BODY > is HTML and var month_income = new Array(12); is a JavaScript statement. Because JavaScript, unlike HTML, is case sensitive, some JavaScript keywords—such as Array —must be written using both upper-case and lower-case letters.

I’ve taken a number of steps to allow you to focus on JavaScript rather than HTML. Later in this chapter, you’ll find step-by-step instructions for creating the HTML test bed for your JavaScript programs. Further on, you’ll find detailed instructions for creating JavaScript programs, along with JavaScript code listings. Mostly, I’ll omit the HTML unless it’s necessary for clarity.

In addition, I’ve added some special graphical features to Learn How to Program to make it easier for you to find the information you need:

You’ll also find the following special icons highlighting important points in the text:

Way Cool

means, as you’d expect, that this is something real neat and groovy!

Do It Right!

explains the right way to do something as opposed to a way that merely “works.”

Try This at Home

highlights fun projects that I encourage you to work out—and extend—on your own.

Advanced Topic

means, as you’d suspect, that the text marked with this icon is relatively advanced. I’ve included the advanced material because it’s important and for completeness. However, don’t worry if you find it difficult—you can simply move on to the next topic. You can always come back later and reread the Advanced Topic sections when they’ll likely make more sense to you.

By the way, you’ll find the code for all the programs explained in the book on the Apress Web site (http://www.apress.com/) in the Downloads section. But I encourage you not to download the code. You’ll learn much more if you enter it yourself at the keyboard.

Learn How to Program Using Any Web Browser
Learn How to Program Using Any Web Browser
ISBN: 1590591135
EAN: 2147483647
Year: 2006
Pages: 115
Authors: Harold Davis

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net