1. Trang chủ
  2. » Công Nghệ Thông Tin

THE BOOK OF JAVASCRIPT, 2ND EDITION phần 1 pps

61 387 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 61
Dung lượng 832,96 KB

Nội dung

[...]... 12 9 Going Off the Deep End 13 0 Using array.length in Your Loop 13 1 An Incremental Shortcut 13 1 Beware of Infinite Loops 13 1 for Loops 13 2 How AntWeb Checks Off All the Checkboxes 13 3 Line-by-Line Analysis of Figure 8 -11 13 3 Creating Your Own Arrays 13 4 Line-by-Line Analysis of Figure 8 -12 13 5 How the Book of JavaScript... Elements 10 9 Reading Information from Text Fields 10 9 Setting the Value of a Text Field 11 0 Textareas 11 1 Checkboxes 11 2 Radio Buttons 11 4 Pull-Down Menus and Scrollable Lists 11 5 Handling Events Using Form Elements 11 6 Make this a Shortcut 11 7 Using Pull-Down Menus as Navigational Tools 11 8 One Last Forms... Constants 16 0 A Timed Slide Show 16 1 Line-by-Line Analysis of Figure 9 -11 16 2 A Safer Version of rotateImage() 16 3 Why Declaring a Variable Outside a Function Is Unsafe 16 3 Why You Can’t Put var Inside a Timing Loop 16 3 The Solution 16 4 The Hitch 16 5 The Solution to the Hitch 16 5 Why image_array Is Declared Outside the rotateImage()... Line-by-Line Analysis of Figure 11 -11 210 Summary 213 Assignment 214 12 S A V IN G V I S IT O R I N F O RM A TI O N W I TH C O O K IE S 215 A Real-World Example of Cookies 216 What Are Cookies? 216 What Cookies Can and Can’t Do 217 Working with Cookies 218 Setting Cookies 218 Reading Cookies 218 Resetting Cookies... Function 18 8 Summary 18 9 Assignment 19 0 11 VALIDATING FORMS, MASSAGING STRINGS, AND WORKING WITH SERVER-SIDE PROGRAMS 19 1 A Real-World Example of Form Validation 19 2 Making Sure a Visitor Has Filled Out a Form Element 19 2 Line-by-Line Analysis of Figure 11 -2 19 4 String Handling 19 6 Breaking Strings Apart 19 6 Matching String... 13 6 Checking for Blank Statements 13 7 Checking the Last Element in the Array 13 7 xii C on t e n t s i n D e t a i l Testing the Limits of Arrays 13 7 The startScroll() Function 13 8 A Streamlined Version 13 9 Loops Can Nest 14 0 Creating Arrays As You Go Along 14 0 Associative Arrays 14 2 Line-by-Line Analysis of Figure 8 -18 ... pages in a number of ways This book offers many examples of JavaScript’s broad capabilities The following are just two examples that illustrate what you can do with JavaScript The first example (Figure 1- 1) is a flashing grid of colored squares (to get the full effect, browse to http://www.bookofjavascript.com/Chapter 01/ Fig 01- 01. html), created by a fellow named Taylor way back in 19 96 Flashy, isn’t... 11 9 How the Doctors Without Borders Pull-Down Navigation Tool Works 12 0 Summary 12 0 Assignment 12 1 8 KEEPING TRACK OF INFORMATION WITH ARRAYS AND LOOPS 12 3 Real-World Examples of Arrays 12 3 JavaScript’s Built-In Arrays 12 4 Figuring Out How Many Items an Array Contains 12 6 Going Through Arrays 12 6 while Loops 12 8... Function 16 6 Summary 16 7 Assignment 16 7 10 U S IN G FR A M E S A N D I M A G E M A P S 16 9 A Real-World Example of Frames and Image Maps 17 0 Frames 17 0 Frame Basics 17 0 Frames and JavaScript 17 2 Frames and Image Swaps 17 4 Changing the Contents of Two Frames at Once 17 6 Frames Inside Frames 17 7 JavaScript... 410 Ruby 410 C REFERENCE TO JAVASCRIPT OBJECTS AND FUNCTIONS 411 alert() 413 Anchor 413 Applet 413 Area 414 Array 414 Button (Including Submit and Reset Buttons) 416 Checkbox 417 clearInterval() 417 clearTimeout() 417 confirm() 418 Date 418 . Shortcut 13 1 Beware of Infinite Loops 13 1 for Loops 13 2 How AntWeb Checks Off All the Checkboxes 13 3 Line-by-Line Analysis of Figure 8 -11 13 3 Creating Your Own Arrays 13 4 Line-by-Line Analysis of Figure. 8 -12 13 5 How the Book of JavaScript Tip Box Works 13 6 Checking for Blank Statements 13 7 Checking the Last Element in the Array 13 7 Contents in Detail xiii Testing the Limits of Arrays 13 7 The. Analysis of Figure 11 -11 210 Summary 213 Assignment 214 12 SAVING VISITOR INFORMATION WITH COOKIES 215 A Real-World Example of Cookies 216 What Are Cookies? 216 What Cookies Can and Can’t Do 217 Working

Ngày đăng: 06/08/2014, 16:23

TỪ KHÓA LIÊN QUAN