1. 1 JavaScript Reason 3
What is 1.2 JavaScript 3?
Problems and Values of 1.3 JavaScript 4
1.4 JavaScript is unreliable. Why use 5?
1.5 JavaScript and basic grammar in webpage 6
1.5. 1 JavaScript Syntax 7
1.5.2 Execute code 8
1.5.3 Function 9
1.6 object 10
1.7 Simple JavaScript example 1 1
1.8 summary 13
Chapter II Data and Judgment 15
2. 1 data, data type and data operator 15
2. 1. 1 string data type 16
2. 1.2 operator 18
2. 1.3 JavaScript variable 20
2. 1.4 Conversion of different data types 22
2.2 Composite data types: arrays and objects 25
2.2. objects provided by1JavaScript: String, Date and Math 26.
Array 33
2.3 judging in JavaScript 39
2.3. 1 logical operators and comparison operators 39
2.3.2 Conditional statement 4 1
2.3.3 Testing Multiple Values: Switch Statement 44
2.3.4 Recurring events: loop 45
2.4 Summary 50
Chapter 3 programming from DHTML to DOM 5 1
3. 1 JavaScript 53 as "behavior layer"
3. 1. 1 Comparison between object detection and browser dependency 55
3. 1.2 Progressive enhancement 57
3.2 JavaScript and accessibility 58
3.3 Good coding practices 59
3.3. 1 naming convention 59
Code layout 60
Note 62
Function 64
3.3.5 Using ternary operators to simplify code 66
3.3.6 Classification and reuse of functions 67
3.3.7 Range of variables and functions
3.3.8 Using Object Literals to Ensure Script Security 68
3.4 Summary 70
Chapter 4 HTML and JavaScript 7 1
4. 1 HTML document analysis 7 1
4.2 Using JavaScript to Provide Feedback in Web Pages: Old Method 75
4.3 Access documents through DOM 80
4.4 Values of Child Nodes, Parent Nodes, Siblings and Elements 83
4.4. 1 From parent node to child node 84
4.4.2 From Child Node to Parent Node 85
4.4.3 Between brother nodes 86
4.5 Modify Element Attributes 90
4.6 Creating, Removing and Replacing Element 9 1
Avoid NOSCRIPT 94
4.6.2 Simplify the script through innerHTML 96
4.6.3 DOM Summary: Your cheat sheet 97
4.6.4 DOMhelp: Our own auxiliary function library 98
4.7 Summary 102
Chapter 5 Representation and Behavior (CSS and Event Handling) 103
5. 1 Change the presentation layer through JavaScript 103.
5.2 Changing the behavior of documents through event handling 129
W3C compliant events 13 1
5.2.2 Fix this event to adapt to W3C incompatible browser 139.
5.2.3 Never Stop Optimizing 144
5.2.4 Page Loading Problems and Their Solutions 145
5.2.5 Reading and filtering keyboard input 146
5.2.6 Danger of accident handling 150
5.3 Summary 15 1
Chapter 6 Common Objects of JavaScript: Pictures and Windows 152
6. 1 pictures and JavaScript 152
6. 1. 1 picture programming basis 153
6. 1.2 Pre-installed pictures 154
6. 1.3 overturning effect 155
6. 1.4 slide show 163
6. 1.5 pictures and JavaScript abstract 176
6.2 Windows and JavaScript 177
6.2. 1 window properties 178
Window method 179
6.2.3 Windows and JavaScript Summary 198
6.3 Summary 199
Chapter 7 Interaction between JavaScript and Users: Navigation and Forms 200
7. 1 Navigation and JavaScript 200
7. 1. 1 Afraid of reloading the webpage 200
7. 1.2 JavaScript navigation basics 20 1
7. 1.3 Browser Navigation 203
7. 1.4 navigation within the page 204
7. 1.5 Website Navigation212
7. 1.6 Page219
7. 1.7 navigation summary with JavaScript 226
7.2 Forms and JavaScript 226
7.2. 1 JavaScript form foundation 227
7.2.2 Form Element 228
7.2.3 Interactive form: hide or show independent element 24 1
7.2.4 Custom Form Elements 245
7.2.5 Forms and JavaScript Summary 246
7.3 Overview 246
Chapter 8 Interacting with Ajax Backend 247
8. What exactly is1Ajax 248?
8.2 caching actually brings trouble 254
8.3 put x back in Ajax 255
8.3. 1 Replace XML 259 with JSON.
8.3.2 Using server-side scripts to access third-party content 26 1
8.3.3 XHR problem about slow link 264
8.3.4 A larger Ajax example: Association selection box 266
Optional dynamic Ajax menu 273
8.4 Summary 280
Chapter 9 Data Verification Technology 282
9. 1 Advantages and disadvantages of client-side JavaScript verification 282
9.2 Using JavaScript to Protect File Content 283
9.3 The myth of universal verification 284
9.4 Basic JavaScript verification using string and number methods 284
9.4. 1 String verification method 284
9.4.2 Digital Verification Method 290
9.5 Regular Expression 293
Grammar and attributes 294
9.5.2 Wildcard Search, Constraint Scope and Its Substitution 295
9.5.3 Use quantifiers to limit the number of characters 295
9.5.4 Word boundaries, blank characters and other shortcut symbols 296
Method of using regular expressions 297
9.5.6 Function of bracket grouping 297
9.5.7 Regular expression resources 298
9.6 Overview of verification methods 299
9.7 Form verification technology 299
9.7. 1 Specify required fields 299
9.7.2 Method of Hiding Fields
9.7.3 indicator element method 30 1
9.7.4 CSS class method 30 1
9.7.5 Custom Attribute Method 302
9.7.6 Disadvantages of these methods 302
9.7.7 * * Verification Rules 302
9.8 User's Feedback Authentication Information 304
9.8. 1 Displays the list of error fields 304.
9.8.2 Replace the main form 308 with a clickable error message.
9.8.3 Highlight the error fields 3 10 respectively.
9.8.4 Immediate verification feedback 3 13
9.9 Other dynamic verification methods 3 14
9. 10 Summary 3 17
Chapter 10 Modern JavaScript Case Study: Dynamic Gallery 3 19
10. 1 Thumbnail Gallery Foundation 3 19
What is 10.2 Thumbnail Gallery and what it should do 3 19.
10.3 still thumbnail gallery 320
10.4 use JavaScript to simulate the dynamic gallery 320.
10.5 display title 326
10.6 Dynamic Thumbnail Library 330
10.7 Create a picture badge from a folder 333
10.8 Summary 340
Chapter 1 1 uses a third-party JavaScript 34 1.
1 1. 1 What does the network provide for you 34 1?
1 1.2 code snippet, RSS feed, various APIs and function libraries 342.
1 1.2. 1 RSS feed and RESTAPI 342
1 1.2.2 RESTAPI example 344
1 1.3 uses a short and pithy function library: jQuery 344.
1 1.4 Use API: Add maps to your website with GoogleMaps 35 1.
1 1.5 full service: Yahoo Developer Network and YUI 360.
1 1.5. 1 Use the flexible title of YUI 36 1.
1 1.5.2 uses YUI's connection manager and container components instead of the pop-up window 366.
YUI summary 370 1. 5. 3
1 1.6 Summary 37 1
Appendix a debugging JavaScript 372
……