Sams Teach Yourself JavaScript in 24 Hours Free Open Book

Sams Teach Yourself JavaScript in 24 Hours

Previous Page
Next Page

Introduction

The World Wide Web began as a simple repository for information, but it has grown into much moreit entertains, teaches, advertises, and communicates. As the Web has evolved, the tools have also evolved. Simple markup tools such as HTML have been joined by true programming languagesincluding JavaScript.

Now don't let the word "programming" scare you. For many, the term conjures up images of long nights staring at the screen, trying to remember which sequence of punctuation marks will produce the effect you need. (Don't get me wrongsome of us enjoy that sort of thing.)

Although JavaScript is programming, it's a very simple language. As a matter of fact, if you haven't programmed before, it makes a great introduction to programming. It requires very little knowledge to start programming with JavaScriptyou'll write your first program in Hour 2, "Creating Simple Scripts."

If you can create a web page with HTML, you can easily use JavaScript to improve a page. JavaScript programs can range from a single line to a full-scale application. In this book, you'll start with simple scripts, and proceed to complex applications, such as a card game. You'll also explore some of the most recent uses of JavaScript, such as AJAX remote scripting.

If you've spent much time developing pages for the Web, you know that the Web is constantly changing, and it can be hard to keep up with the latest languages and tools. This book will help you add JavaScript to your web development toolbox, and I think you'll enjoy learning it.

JavaScript and Web Standards

When JavaScript first appeared in browsers, it had rather limited capabilities, and JavaScript programmers have always pushed the envelope to take maximum advantage of what the language was capable of. Unfortunately, this resulted in some bad practices, such as scripts that only worked in one browser, and JavaScript gained a bit of a bad reputation.

Now, thanks to wide browser support for standards established by the W3C (World Wide Web Consortium) and new technologies such as AJAX, JavaScript's future is looking brighter than ever, and a new, more responsible style of scripting is gaining favor. Unobtrusive scripting focuses on adding interactive features while keeping the HTML simple and standards-compliant.

Throughout this book, you'll learn the best practices for using JavaScript responsibly and following web standards. All of the examples in this book avoid browser-specific techniques in favor of standard techniques, and all of the examples will work in most modern browsers.

How to Use This Book

This book is divided into 24 lessons. Each covers a single JavaScript topic, and should take about an hour to complete. The lessons start with the basics of JavaScript, and continue with more advanced topics. You can study an hour a day, or whatever pace suits you. (If you choose to forego sleep and do your studying in a single 24-hour period, you might have what it takes to be a computer book author.)

Organization of This Book

This book is divided into six parts, each focusing on one area of JavaScript:

  • Part I, "Introducing the Concept of Web Scripting and the JavaScript Language," introduces JavaScript, describes how it fits in with other languages, and explains the basic language features of JavaScript. It also introduces the DOM (Document Object Model), which connects JavaScript to web documents.

  • Part II, "Learning JavaScript Basics," covers the fundamentals of the JavaScript language: variables, functions, objects, loops and conditions, and built-in functions. You'll also learn about third-party libraries that add functionality to JavaScript.

  • Part III, "Learning More About the DOM," digs deeper into the DOM objects you'll use in nearly every JavaScript program. It covers events, windows, and web forms. You'll also learn about CSS style sheets, and the DOM features that enable you to change styles. Finally, you'll learn about the W3C DOM, which enables you to modify any part of a page using JavaScript.

  • Part IV, "Working with Advanced JavaScript Features," begins with a look at unobtrusive scripting techniques to keep JavaScript from intruding on the functionality and validity of HTML documents. You'll also learn how to debug JavaScript applications, and finally take a look at two cutting-edge JavaScript features: AJAX and Greasemonkey.

  • Part V, "Building Multimedia Applications with JavaScript," describes JavaScript's features for working with graphics, animation, sound, and browser plug-ins.

  • Part VI, "Creating Complex Scripts," focuses on helping you create complete JavaScript applications. You'll learn how to create drop-down menus, a card game written in JavaScript, and other examples. In the last hour, you'll learn about what's in store for JavaScript and what other languages you might want to learn next.

Conventions Used in This Book

This book contains special elements as described by the following:

A special monospace font is used on programming-related terms and language.

Did you Know?

These boxes highlight information that can make your JavaScript programming more efficient and effective.


By the Way

These boxes provide additional information related to material you just read.


Watch Out

These boxes focus your attention on problems or side effects that can occur in specific situations.


Try It Yourself

The Try It Yourself section at the end of each chapter guides you through the process of creating your own script or applying the techniques learned throughout the hour. This will help you create practical applications of JavaScript based on what you've learned.


Q&A, Quiz, and Exercises

At the end of each hour's lesson, you'll find three final sections. Q&A answers a few of the most common questions about the hour's topic. The Quiz tests your knowledge of the skills you learned in that hour, and the Exercises offer ways for you to gain more experience with the techniques the hour covers.

This Book's Website

Because JavaScript and the Web are constantly changing, you'll need to stay up-to-date after reading this book. This book's website includes the latest updates as well as downloadable versions of the listings and graphics for the examples used in this book. To access the book's website, register your book at http://www.samspublishing.com/register.

The Author's Website

The author of this book, Michael Moncur, maintains a website about JavaScript at http://www.jsworkshop.com/. There you'll find regular updates on the JavaScript language and the DOM, links to script examples, and detailed tutorial articles.

If you have questions or comments about this book, have noticed an error, or have trouble getting one of the scripts to work, you can also reach the author by email at js4@starlingtech.com. (Please check the website first to see if your question has been answered.)

Previous Page
Next Page
Index: [SYMBOL][A][B][C][D][E][F][G][H][I][J][K][L][M][N][O][P][Q][R][S][T][U][V][W][X][Y]


     Main Menu
Sams Teach Yourself JavaScript in 24 Hours
Table of Contents
Copyright
About the Author
Acknowledgments
We Want to Hear from You!
Introduction
Part I: Introducing the Concept of Web scripting and the JavaScript Language
Part II: Learning JavaScript Basics
Part III: Learning More About the DOM
Part IV: Working with Advanced JavaScript Features
Part V: Building Multimedia Applications with JavaScript
Part VI: Creating Complex Scripts
Part VII: Appendixes
Index


More Books
PHP Hacks
Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
The Koran (Holy Qur'an)
Macromedia Flash 8 Bible
Search Engine Optimization for Dummies
YouTube Traffic
PHP 5 for Dummies
Harry Potter and The Chamber of Secrets
Harry Potter and the Sorcerer's Stone
The Pilgrim's Progress
Wireless Hacks
Flash Hacks. 100 Industrial-Strength Tips & Tools
PayPal Hacks. 100 Industrial-Strength Tips and Tools
Amazon Hacks
Pdf Hacks
The Da Vinci Code
Google Hacks
The Holy Bible
Windows XP For Dummies
Harry Potter and the Half-Blood Prince
Seo Book
Upgrading and Repairing Networks
Macromedia Dreamweaver 8 UNLEASHED
Windows XP Annoyances
Windows XP Hacks
Microsoft Windows XP Power Toolkit
Teach Yourself MS Office In 24Hours
iPod & iTunes Missing Manual
PC Hacks 100 Industrial-Strength Tips and Tools
PC Overclocking, Optimization, and Tuning - 2th Edition
PC Hardware In A Nutshell 3rd Edition
PC Hardware in a Nutshell, 2nd Edition
Upgrading and Repairing PCs
Google for Dummies
MySQL Cookbook
Teach Yourself Macromedia Flash 8 In 24 Hours
PHP CookBook
Sams Teach Yourself JavaScript in 24 Hours
PHP5 Manual
Free Games Paper Airplanes
500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele