|
Free Open Book
Sams Teach Yourself JavaScript in 24 Hours |
IntroductionThe 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 StandardsWhen 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 BookThis 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 BookThis book is divided into six parts, each focusing on one area of JavaScript:
Conventions Used in This BookThis 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.
Q&A, Quiz, and ExercisesAt 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 WebsiteBecause 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 WebsiteThe 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.) |
Main Menu |
| 500 Juegos Gratis | 500 Giochi Gratis | 500 Jeux Gratuits | 500 Jogos Gratis | 500 Kostenlose Spiele |