Beginning JavaScript Third Edition phần 1 pdf

79 455 0
Beginning JavaScript Third Edition phần 1 pdf

Đ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

[...]... Questions Question 1 Question 2 Question 3 Chapter 6: HTML Forms — Interacting with the User HTML Forms Other Form Object Properties and Methods HTML Elements in Forms Common Properties and Methods Button Form Elements Text Elements textarea Element Check Boxes and Radio Buttons The select Elements 16 1 16 3 16 3 16 4 16 4 16 5 16 9 17 5 18 5 18 6 18 6 18 6 18 6 18 7 18 8 19 0 19 1 19 3 19 4 19 7 204 207 215 xiii Contents... 10 2 10 2 10 3 10 3 10 5 10 5 10 5 10 6 10 7 11 0 Contents The JavaScript Native Objects 11 1 String Objects The Math Object Number Object Array Objects Date Objects JavaScript Classes 11 1 12 2 12 9 13 0 13 7 14 6 Summary Exercise Questions 15 6 15 7 Question 1 Question 2 Question 3 15 7 15 7 15 7 Chapter 5: Programming the Browser 15 9 Introduction to the Browser Objects 16 0 The window Object — Our Window onto the Page The... 1 2 3 4 Chapter 4: JavaScript — An Object-Based Language Object-Based Programming A Brief Introduction to Objects Objects in JavaScript Using JavaScript Objects Primitives and Objects xii 58 61 62 62 62 63 64 64 66 70 73 77 78 79 84 84 87 88 90 91 92 Creating Your Own Functions Variable Scope and Lifetime Question Question Question Question 54 92 96 97 10 0 10 2 10 2 10 2 10 3 10 3 10 5 10 5 10 5 10 6 10 7 11 0... Your “No Plug-in or ActiveX Control” Redirection Script Potential Problems Summary Exercise Question Question 1 Chapter 16 : Ajax and Remote Scripting What Is Remote Scripting? What Can It Do? Ajax Browser Support Ajax with JavaScript: The XMLHttpRequest Object 614 614 617 618 618 619 619 619 6 21 6 21 622 Cross-Browser Issues Using the XMLHttpRequest Object Asynchronous Requests 622 626 627 Creating a Remote... Strings Data Type Conversion Dealing with Strings That Won’t Convert ix xix 1 1 1 2 3 4 4 6 12 13 16 18 18 21 21 22 22 24 24 25 28 30 30 31 32 35 35 39 42 44 45 48 Contents Arrays 49 A Multi-Dimensional Array The “Who Wants To Be A Billionaire” Trivia Quiz — Storing the Questions Using Arrays Summary Exercise Questions Question 1 Question 2 Chapter 3: Decisions, Loops, and Functions Decision Making —... split() Method replace() Method search() Method match() Method Using the RegExp Object’s Constructor xiv 257 257 264 269 270 2 71 272 287 289 289 289 2 91 292 292 295 296 296 297 297 300 308 308 312 312 314 318 318 3 21 Contents The Trivia Quiz Summary Exercise Questions Question 1 Question 2 Question 3 Chapter 9: Date, Time, and Timers World Time Setting and Getting a Date Object’s UTC Date and Time Timers... Publisher Joseph B Wikert Contents Acknowledgments Introduction Chapter 1: Introduction to JavaScript and the Web Introduction to JavaScript What Is JavaScript? JavaScript and the Web Why Choose JavaScript? What Can JavaScript Do for Me? Tools Needed to Create JavaScript Web Applications The Tag and Your First Simple JavaScript Program A Brief Look at Browsers and Compatibility Problems Introducing... by the second script block, as shown in Figure 1- 4 Click OK, and again the parsing continues, with the third paragraph, Paragraph 3, being displayed The web page is complete, as shown in Figure 1- 5 9 Chapter 1: Introduction to JavaScript and the Web Figure 1- 4 Figure 1- 5 10 Chapter 1: Introduction to JavaScript and the Web How It Works The first part of the page is the same as in our earlier example... catch Statements Summary Exercise Questions Question 1 Question 2 322 329 330 330 3 31 3 31 333 334 339 347 348 352 354 360 360 360 360 3 61 3 61 362 363 364 364 365 365 366 367 367 368 370 388 393 393 394 404 405 405 405 xv Contents Chapter 11 : Storing Information: Cookies 407 Baking Your First Cookie 407 A Fresh-Baked Cookie The Cookie String 408 415 Creating a Cookie Getting a Cookie’s Value Cookie... using JavaScript You’ll look at this later in the book as well One last thing: Throughout this book we’ll be referring to the Internet Explorer browser as IE Why Choose JavaScript? JavaScript is not the only scripting language; there are others such as VBScript and Perl So why choose JavaScript over the others? 3 Chapter 1: Introduction to JavaScript and the Web The main reason for choosing JavaScript . Beginning JavaScript ® Third Edition Paul Wilton Jeremy McPeak 01_ 0 515 11 ffirs.qxp 4 /13 /07 6 :19 PM Page iii Beginning JavaScript ® Third Edition 01_ 0 515 11 ffirs.qxp 4 /13 /07 6 :19 PM Page i 01_ 0 515 11. i 01_ 0 515 11 ffirs.qxp 4 /13 /07 6 :19 PM Page ii Beginning JavaScript ® Third Edition Paul Wilton Jeremy McPeak 01_ 0 515 11 ffirs.qxp 4 /13 /07 6 :19 PM Page iii Beginning JavaScript ® , Third Edition Published. Objects 10 7 Primitives and Objects 11 0 02_0 515 11 ftoc.qxp 4 /13 /07 6:23 PM Page xii xiii Contents The JavaScript Native Objects 11 1 String Objects 11 1 The Math Object 12 2 Number Object 12 9 Array

Ngày đăng: 09/08/2014, 14:21

Từ khóa liên quan

Mục lục

  • Beginning JavaScript, Third Edition

    • About the Authors

    • Acknowledgments

    • Credits

    • Contents

    • Introduction

      • Whom This Book Is For

      • What This Book Covers

      • What You Need to Use This Book

      • Conventions

      • Source Code

      • Errata

      • p2p.wrox.com

      • Chapter 1: Introduction to JavaScriptand the Web

        • Introduction to JavaScript

          • What Is JavaScript?

          • Why Choose JavaScript?

          • What Can JavaScript Do for Me?

          • Tools Needed to Create JavaScriptWeb Applications

          • The <script> Tag and Your First SimpleJavaScript Program

          • A Brief Look at Browsers and Compatibility Problems

          • Introducing the “Who Wants To Be A Billionaire” Trivia Quiz

            • Ideas Behind the Coding of the Trivia Quiz

            • What Functionality to Add and Where?

            • Summary

Tài liệu cùng người dùng

Tài liệu liên quan