Chapter 3. Your First JavaScript Script

IN THIS CHAPTER

  • How to choose basic JavaScript authoring tools

  • How to set up your authoring environment

  • How to enter a simple script to a web page

In this chapter, you set up a productive scriptwriting and previewing environment on your computer; then you write a simple script whose results you can see in your JavaScript-compatible browser.

Because of differences in the way various personal computing operating systems behave, I present details of environments for two popular variants: Windows (95 through XP) and Mac OS X. For the most part, your JavaScript authoring experience is the same regardless of the operating system platform you use—including Linux or Unix. Although there may be slight differences in font designs depending on your browser and operating system, the information remains the same. Most illustrations of browser output in this book are made from the Windows XP version of Internet Explorer 6. If you run another browser or version, don't fret if every pixel doesn't match the illustrations in this book.

The Software Tools

The best way to learn JavaScript is to type the HTML and scripting code into documents in a text editor. Your choice of editor is up to you, although I provide you some guidelines for choosing a text editor in the next section.

Choosing a text editor

For the purposes of learning JavaScript in this book, avoid WYSIWYG (What You See Is What You Get) web-page authoring tools, such as FrontPage and Dreamweaver, for now. ...

Get JavaScript® Bible, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.