Introduction
Welcome to JavaScript: A Beginner’s Guide, Fourth Edition! Years ago, I was surfing the Web and noticed that people were publishing pages about themselves and calling them homepages. After viewing a number of these, I decided to create a homepage myself. I had no idea where to begin but, through trial and error, I figured out how to code HTML and publish my documents on a Web server. Over time, I saw some interesting effects used on other homepages (like alert messages that popped up out of nowhere or images that would magically change when I moved my mouse over them). I was curious and just had to know what was being done to create those effects. Were these page creators using HTML tags I did not know about?
Eventually, one site revealed what they were using to create those effects: JavaScript. I went in search of information on it, and came across a few tutorials and scripts on the Web. Since I had programmed in other languages (such as a relatively obscure language called Ada), I was able to catch on to JavaScript fairly quickly by looking at these tutorials and scripts.
I learned enough that I decided to create a Web site that would teach HTML and JavaScript to beginners. As soon as I began the project, I received questions from visitors that were way over my head—forcing me to dig deeper and learn more about JavaScript. As a result, I became completely familiar with this scripting language and what it can do. Not only can you add fun effects to a Web page, you can create scripts that will perform useful tasks, like validate form input, add navigational elements to documents, or react to user events.
The goal of this book is to help you to learn the basics of the JavaScript language with as little hair pulling and monitor smashing as possible. You do not need any prior programming experience to learn JavaScript from this book. All you need is knowledge of HTML and/or XHTML, Cascading Style Sheets (CSS), and how to use your favorite text editor and Web browser (see Chapter 1 for more information).
What This Book Covers
The 16 chapters of this book cover specific topics on the JavaScript language. The first two chapters cover the most basic aspects of the language: what it is, what you need to know to begin using JavaScript, and how to place JavaScript into an HTML file. The middle of the book (Chapters 3–14) covers beginning JavaScript topics from variables all the way to using JavaScript with forms. The final two chapters (Chapters 15–16) introduce some advanced techniques, and point you toward resources if you want to learn more about JavaScript once you have completed the book.
This book includes a number of special features in each chapter to assist you in learning JavaScript. These features include
    Key Skills & Concepts   Each chapter begins with a set of key skills and concepts that you will understand by the end of the chapter.
    Ask the Expert   The Ask the Expert sections present commonly asked questions about topics covered in the preceding text, with responses from the author.
    Try This   These sections get you to practice what you have learned using a hands-on approach. Each Try This will have you code a script through step-by-step directions on what you need to do to in order to accomplish the goal. You can find solutions to each project on the McGraw-Hill/Professional Web site at www.mhprofessional.com/computingdownload.
    Notes, Tips, and Cautions   Notes, Tips, and Cautions call your attention to noteworthy statements that you will find helpful as you move through the chapters.
    Code   Code listings display example source code used in scripts or programs.
    Callouts   Callouts display helpful hints and notes about the example code, pointing to the relevant lines in the code.
    Self Test   Each chapter ends with a Self Test, a series of 15 questions to see if you have mastered the topics covered in the chapter. The answers to each Self Test can be found in the appendix.
That is it! You are now familiar with the organization and special features of this book to start your journey through JavaScript. If you find that you are stuck and need help, feel free to get online and visit the JavaScript discussion forums on the Web Xpertz Web site at www .webxpertz.net/forums. The forums will allow you to interact with other JavaScript coders who may be able to help you with your questions. If you would like to contact me, you can send me a message on my Web site (www.scripttheweb.com/about/contact.html) or you can find me on Twitter (@ScripttheWeb).
Now it is time to learn JavaScript. Get ready, get set, and have fun!
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.80.216