1. Trang chủ
  2. » Giáo án - Bài giảng

sams teach yourself javascript in 24 hours 3rd (2002)

451 815 1

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Sams Teach Yourself JavaScript in 24 Hours

    • Copyright © 2002 by Sams Publishing

    • Contents at a Glance

    • Contents

    • About the Author

    • We Want to Hear from You!

  • Introduction

    • How to Use This Book

    • Q&A, Quiz, and Exercises

    • This Book’s Web Site

  • PART I Getting Started

    • HOUR 1 Understanding JavaScript

      • Learning Web Scripting Basics

      • How JavaScript Fits into a Web Page

      • Browsers and JavaScript

      • Alternatives to JavaScript

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 2 Creating a Simple Script

      • Tools for Scripting

      • What Time is It?

      • Beginning the Script

      • Adding JavaScript Statements

      • Creating Output

      • Adding the Script to a Web Page

      • Testing the Script

      • Workshop: Hiding Scripts from Older Browsers

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 3 How JavaScript Programs Work

      • Combining Tasks with Functions

      • Understanding Objects

      • Handling Events

      • Conditional Statements

      • Loops

      • Which Script Runs First?

      • Workshop: Using Comments

      • Summary

      • Q&A

      • Quiz

      • Exercises

  • PART II Learning JavaScript Basics

    • HOUR 4 Using Functions and Variables

      • Using Functions

      • Understanding Expressions and Operators

      • Using Variables

      • Data Types in JavaScript

      • Converting Between Data Types

      • Workshop: Storing User Data in Variables

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 5 Using Strings and Arrays

      • Using String Objects

      • Working with Substrings

      • Using Numeric Arrays

      • Using String Arrays

      • Sorting a Numeric Array

      • Workshop: Displaying a Scrolling Message

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 6 Testing and Comparing Values

      • The if Statement

      • Using Shorthand Conditional Expressions

      • Using Multiple Conditions with switch

      • Workshop: Evaluating a User Response

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 7 Repeating Yourself: Using Loops

      • Using for Loops

      • Using while Loops

      • Using do…while Loops

      • Working with Loops

      • Using for…in loops

      • Workshop: Working with Arrays and Loops

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 8 Using Math and Date Functions

      • What Is an Object?

      • The Math Object

      • Working with Dates

      • Workshop: Working with the Math Object

      • Summary

      • Q&A

      • Quiz

      • Exercises

  • PART III The Document Object Model (DOM)

    • HOUR 9 Working with the Document Object Model

      • Understanding the Document Object Model

      • Using window Objects

      • Working with Web Documents

      • Accessing Browser History

      • Working with the location Object

      • Reading Information about the Browser

      • Workshop: Creating Back and Forward Buttons

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 10 Responding to Events

      • Understanding Event Handlers

      • Using Mouse Events

      • Using Keyboard Events

      • Using the onLoad and onUnload Events

      • Workshop: Adding Link Descriptions to a Web Page

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 11 Using Windows and Frames

      • Controlling Windows with Objects

      • Moving and Resizing Windows

      • Using Timeouts

      • Displaying Dialog Boxes

      • Working with Frames

      • Workshop: Creating a Navigation Frame

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 12 Getting Data with Forms

      • The Basics of HTML Forms

      • Using the form Object with JavaScript

      • Scripting Form Elements

      • Displaying Data from a Form

      • Sending Form Results by Email

      • Workshop: Validating a Form

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 13 Using Graphics and Animation

      • Using Image Maps with JavaScript

      • Using Dynamic Images in JavaScript

      • Creating Rollovers

      • Workshop: Creating a Simple Animation

      • Summary

      • Q&A

      • Quiz

      • Exercises

  • PART IV Moving on to Advanced JavaScript Features

    • HOUR 14 Creating Cross-Browser Scripts

      • Reading Browser Information

      • Supporting Browsers with JavaScript

      • Supporting Non-JavaScript Browsers

      • Workshop: Scripting for Multiple Browsers

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 15 Creating Custom Objects

      • Using Objects to Simplify Scripting

      • Creating an Object Instance

      • Customizing Built-In Objects

      • Workshop: Storing Data in Objects

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 16 Working with Sounds and Plug-Ins

      • Introducing Plug-Ins

      • Working with Plug-In Objects

      • Workshop: Playing Music with the Mouse

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 17 Debugging JavaScript Applications

      • Avoiding Bugs

      • Basic Debugging Tools

      • Creating Error Handlers

      • Workshop: Debugging a Script

      • Summary

      • Q&A

      • Quiz

      • Exercises

  • PART V Working with Dynamic HTML (DHTML)

    • HOUR 18 Working with Style Sheets

      • Style and Substance

      • Defining and Using CSS Styles

      • Using CSS Properties

      • Creating a Simple Style Sheet

      • Using External Style Sheets

      • Controlling Styles with JavaScript

      • Workshop: Creating Dynamic Styles

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 19 Using Dynamic HTML (DHTML)

      • Understanding DOM Structure

      • Creating Positionable Elements

      • Workshop: Creating Dynamic HTML Animation

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 20 Using Advanced DOM Features

      • Working with DOM Nodes

      • Hiding and Showing Objects

      • Modifying Text within a Page

      • Adding Text to a Page

      • Workshop: A Better Scrolling Message

      • Summary

      • Q&A

      • Quiz

      • Exercises

  • PART VI Putting It All Together

    • HOUR 21 Improving a Web Page with JavaScript

      • Creating the HTML Document

      • Using Drop-Down Lists for Navigation

      • Adding Link Descriptions

      • Adding Graphic Links

      • Workshop: Finishing up the Page

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 22 Creating a JavaScript Game

      • Planning the Program

      • Writing the Program

      • Workshop: Putting It All Together

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 23 Creating DHTML Applications

      • Creating a Dynamic Site Map

      • Creating Drop-Down Menus

      • Workshop: Creating a Scrolling Text Box

      • Summary

      • Q&A

      • Quiz

      • Exercises

    • HOUR 24 JavaScript Tips and Tricks

      • Learning Advanced JavaScript Techniques

      • Future Web Technologies

      • Planning for the Future

      • A few JavaScript Tips

      • Workshop: Using Cookies

      • Summary

      • Q&A

      • Quiz

      • Exercises

  • PART VII Appendices

    • APPENDIXA Other JavaScript Resources

      • Other Books

      • JavaScript Web Sites

      • Web Site Development

      • Dynamic HTML Web Sites

      • CGI Resources

      • This Book’s Web Site

    • APPENDIX B Tools for JavaScript Developers

      • HTML and Text Editors

      • HTML Validators

      • Debugging Tools

    • APPENDIX C Glossary

    • APPENDIXD JavaScript Quick Reference

      • Built-in Objects

      • Creating and Customizing Objects

      • JavaScript Statements

      • JavaScript Built-in Functions

    • APPENDIX E DOM Quick Reference

      • DOM Level 0

      • DOM Level 1

  • INDEX

Nội dung

[...]... Programming Practices 240 Avoiding Common Mistakes 240 Basic Debugging Tools 242 Netscape’s JavaScript Console 242 Displaying Error Messages in Internet Explorer 243 Alert Messages and the Status Line 244 Using Comments 244 Other Debugging Tools 245 Creating Error Handlers 245 Using the onerror Property 245 Displaying Information... HOUR 16 Working with Sounds and Plug-Ins 225 Introducing Plug-Ins 226 Using the Tag 226 Using the Tag 227 Understanding MIME Types 228 Working with Plug -In Objects 228 Checking for Plug-Ins 229 Listing Plug-Ins 229 Using Objects in Plug-Ins 230 Workshop: Playing Music with the Mouse 231 Embedding the... and Frames 147 Controlling Windows with Objects 148 Creating a New Window 148 Opening and Closing Windows 149 Moving and Resizing Windows 150 Using Timeouts 152 Updating a Page with Timeouts 152 Displaying Dialog Boxes 154 Creating a Script to Display Dialog Boxes 156 Working with Frames 157 Using JavaScript Objects for... with Dishonest Browsers 204 Supporting Browsers with JavaScript 207 Creating a Browser-Specific Page 207 Branching to Separate Pages 207 Making a Multiple-Browser Page 208 Using Feature Sensing 208 xii Sams Teach Yourself JavaScript in 24 Hours Supporting Non -JavaScript Browsers 209 Workshop: Scripting for Multiple Browsers 210 Summary... book Email: webdev@samspublishing.com Mail: Mark Taber Associate Publisher Sams Publishing 800 East 96th Street Indianapolis, IN 4 6240 USA Reader Services For more information about this book or another Sams Publishing title, visit our Web site at www.samspublishing.com Type the ISBN (excluding hyphens) or the title of a book in the Search field to find the page you’re looking for Introduction The World... Creating a JavaScript Game 319 Planning the Program 320 Creating Graphics 320 Choosing Variables 320 Creating the HTML Document 321 Writing the Program 323 Handling the Deal/Draw Button 323 Shuffling the Deck 324 Dealing the Cards 324 Holding and Discarding Cards 325 Drawing New Cards 326 Calculating... Using Graphics and Animation 183 Using Image Maps with JavaScript 184 Using Dynamic Images in JavaScript 186 Working with the images Array 187 Preloading Images 188 Creating Rollovers 188 Workshop: Creating a Simple Animation 190 Creating the Images 190 Creating the HTML Document 191 Defining the Variables 191 Stepping... studying in a single 24- hour period, you may have what it takes to be a computer book author.) 2 Sams Teach Yourself JavaScript in 24 Hours 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 includes three questions to test your knowledge, and the Exercises offer ways for you to gain... this book introduces the concept of Web scripting and the JavaScript language It also describes how JavaScript, Java, and other Web languages fit into the scheme of things The following topics will be covered in this hour: • What Web scripting is, and what it’s good for • How scripting and programming are different (and similar) 6 Hour 1 • What JavaScript is • How to include JavaScript commands in a Web... require the interpreter (in JavaScript s case, usually a browser) in order to work Introducing JavaScript JavaScript was developed by Netscape Communications Corporation, the makers of the popular Netscape Web browser JavaScript was the first Web scripting language to be introduced, and it is still by far the most popular JavaScript was originally called LiveScript and was first introduced in Netscape . St.,Indianapolis,Indiana,4 6240 USA Michael Moncur JavaScript in 24 Hours Teach Yourself 00 0672 3240 67 fm 5/16/02 12:17 PM Page i Sams Teach Yourself JavaScript in 24 Hours Copyright © 2002 by Sams. Messages in Internet Explorer 243 Alert Messages and the Status Line 244 Using Comments 244 Other Debugging Tools 245 Creating Error Handlers 245 Using the onerror Property 245 Displaying Information. Debugging JavaScript Applications 239 Avoiding Bugs 240 Using Good Programming Practices 240 Avoiding Common Mistakes 240 Basic Debugging Tools 242 Netscape’s JavaScript Console 242 Displaying

Ngày đăng: 28/04/2014, 17:07

TỪ KHÓA LIÊN QUAN