JavaScript Advanced Programming (3rd edition) pdf

Source: Internet
Author: User
Tags instance method serialization xpath xslt

: Network Disk Download

Content Introduction· · · · · ·

This book is the latest version of the JavaScript super bestseller. ECMAScript 5 and HTML5 both won in the battle for standards, allowing a large number of proprietary implementations and client-side extensions to formally enter the norm, while also adding a lot of new features to JavaScript for future development. This edition of the book, in addition to adding 5 new content, other chapters also have more substantial additions and revisions, the new content of about One-third. The whole book discusses the object-oriented programming, AJAX and Comet server-side communication, HTML5 forms, media, Canvas (including WebGL), and web from the various components of the JavaScript language-the core of the language, the DOM, the BOM, the event model. New APIs such as Workers, geolocation, cross-document messaging, client storage (including INDEXEDDB), as well as offline applications and best practices related to maintenance, performance, and deployment. The appendix of this book looks forward to the future API and ECMAScript Harmony specifications.

This book is suitable for Web application developers with certain programming experience to read, but also can be used as a teaching material for relevant professional courses in college and social practical technology training.

Author profile ...

Author Profile:

Nicholas C. Zakas (Nicholas Cass), the world's top web technology expert, is now the Yahoo! Interface Presentation Architect, responsible for the design of my yahoo! and Yahoo Home and other large traffic sites. Nicholas has extensive experience in web development and interface design, and has been involved in the development of web solutions for many world-class companies. He is also the author of the high Performance JavaScript book and has collaborated with others in writing professional Ajax and even Faster Web Sites. Nicholas holds a bachelor's degree in computer Science from Merrimack College and an MBA from Eddie Colt College. His personal website is www.nczonline.net, and his Twitter alias is @slicknet.

Catalog/Directory
1th JavaScript Introduction 1
1.1 JavaScript Brief History 1
1.2 JavaScript Implementation 2
1.2.1 ECMAScript 3
1.2.2 Document Object Model (DOM) 5
1.2.3 Browser Object Model (BOM) 8
1.3 JavaScript version 8
1.4 Summary 9
2nd. Using JavaScript in HTML 10
2.1 <script> Elements 10
2.1.1 The position of the label 12
2.1.2 Delay Script 13
2.1.3 Asynchronous Script 13
2.1.4 Usage in XHTML 14
2.1.5 Deprecated Syntax 16
2.2 Embed code with external file 16
2.3 Document Mode 16
2.4 <noscript> Elements 18
2.5 Summary 18
3rd. Basic Concepts 19
3.1 Syntax 19
3.1.1 Case Sensitive 19
3.1.2 Identifier 19
3.1.3 Notes 20
3.1.4 Strict Mode 20
3.1.5 Statement 20
3.2 keywords and reserved words 21
3.3 Variables 22
3.4 Data Type 23
3.4.1 typeof operator 23
3.4.2 Undefined Type 24
3.4.3 NULL Type 25
3.4.4 Boolean Type 26
3.4.5 Number Type 27
3.4.6 String Type 32
3.4.7 Object Type 35
3.5 operator 36
3.5.11-dollar operator 36
3.5.2-bit operator 39
3.5.3 Boolean operator 44
3.5.4 multiplicative operator 47
3.5.5 additive operator 48
3.5.6 Relational operator 50
3.5.7 equality operator 51
3.5.8 conditional operator 53
3.5.9 Assignment operator 53
3.5.10 comma operator 54
3.6 Statement 54
3.6.1 If statement 54
3.6.2 Do-while Statement 55
3.6.3 While Statement 55
3.6.4 for Statement 56
3.6.5 for-in Statement 57
3.6.6 Label Statement 58
3.6.7 break and Continue statements 58
3.6.8 With Statement 60
3.6.9 Switch Statement 60
3.7 Functions 62
3.7.1 Understanding Parameters 64
3.7.2 Not overloaded 66
3.8 Summary 67
Chapter 4th variables, scopes, and memory issues 68
4.1 Values for base types and reference types 68
4.1.1 Dynamic Properties 68
4.1.2 Copy Variable Value 69
4.1.3 Passing Parameters 70
4.1.4 Detection Type 72
4.2 Execution Environment and scope 73
4.2.1 Extending the scope chain 75
4.2.2 No block-level scope 76
4.3 Garbage collection 78
4.3.1 Mark Clear 78
4.3.2 Reference Count 79
4.3.3 Performance Issues 80
4.3.4 Managing Memory 81
4.4 Summary 81
5th Chapter Reference Type 83
5.1 Object Type 83
5.2 Array Type 86
5.2.1 Detecting Arrays 88
5.2.2 Conversion Method 89
5.2.3 Stack Method 90
5.2.4 Queue Method 91
5.2.5 Reordering Method 92
5.2.6 Method of Operation 94
5.2.7 Location Method 95
5.2.8 Iterative Method 96
5.2.9 Reduction Method 97
5.3 Date Type 98
Method of 5.3.1 Inheritance 100
5.3.2 Date Formatting Method 101
5.3.3 Date/Time component Method 102
5.4 RegExp Type 103
5.4.1 RegExp Instance Properties 105
5.4.2 RegExp Instance Method 106
5.4.3 RegExp Constructor Property 107
Limitations of the 5.4.4 Model 109
5.5 Function Type 110
5.5.1 no overloads (in-depth understanding) 111
5.5.2 function declaration and function Expression 111
5.5.3 function as a value 112
5.5.4 function Internal Properties 113
5.5.5 function Properties and methods 116
5.6 Basic Packaging Type 118
5.6.1 Boolean Type 120
5.6.2 Number Type 120
5.6.3 String Type 122
5.7 Single built-in object 130
5.7.1 Global Object 131
5.7.2 Math Object 134
5.8 Summary 137
6th. Object-Oriented Programming 138
6.1 Understanding Objects 138
6.1.1 Property Type 139
6.1.2 Defining multiple Properties 142
6.1.3 properties of a read property 143
6.2 Creating an Object 144
6.2.1 Factory mode 144
6.2.2 Constructor Mode 144
6.2.3 Prototype Mode 147
6.2.4 combination using constructor mode and prototype mode 159
6.2.5 Dynamic Prototype Mode 159
6.2.6 Parasitic constructor mode 160
6.2.7 Secure Constructor Mode 161
6.3 Inheritance 162
6.3.1 prototype chain 162
6.3.2 borrowing a constructor 167
6.3.3 Combination Inheritance 168
6.3.4 Prototype Inheritance 169
6.3.5 Parasitic Inheritance 171
6.3.6 Parasitic combined inheritance 172
6.4 Summary 174
7th function Expression 175
7.1 Recursion 177
7.2 Closure Pack 178
7.2.1 Closures and Variables 181
7.2.2 about this object 182
7.2.3 Memory Leak 183
7.3 Impersonation block-level scope 184
7.4 Private Variables 186
7.4.1 Static Private Variable 188
7.4.2 Module Mode 189
7.4.3 Enhanced Module Mode 191
7.5 Summary 192
8th. BOM 193
8.1 Window Object 193
8.1.1 Global Scope 193
8.1.2 window relationship and framework 194
8.1.3 Window Position 197
8.1.4 Window Size 198
8.1.5 Navigating and opening Windows 199
8.1.6 Intermittent Call and timeout call 203
8.1.7 System dialog Box 205
8.2 Location Object 207
8.2.1 Query string parameter 207
8.2.2 Position Operation 208
8.3 Navigator Object 210
8.3.1 Detection Plug-in 211
8.3.2 Registration Handler 213
8.4 Screen Object 214
8.5 History Object 215
8.6 Summary 216
9th Client Detection 217
9.1 Capability Detection 217
9.1.1 more reliable Capability detection 218
9.1.2 capability detection, not browser detection 220
9.2 Quirks Detection 220
9.3 User Agent Detection 221
9.3.1 History of user agent strings 222
9.3.2 User Agent string detection technology 228
9.3.3 Complete Code 242
9.3.4 How to use 245
9.4 Summary 246
10th Chapter DOM 247
10.1 Node Level 247
10.1.1 Node Type 248
10.1.2 Document Type 253
10.1.3 Element Type 261
10.1.4 Text Type 270
10.1.5 Comment Type 273
10.1.6 cdatasection Type 274
10.1.7 DocumentType Type 274
10.1.8 DocumentFragment Type 275
10.1.9 attr Type 276
10.2 Dom Operation Technology 277
10.2.1 Dynamic Scripting 277
10.2.2 Dynamic Style 279
10.2.3 Operation Form 281
10.2.4 using NodeList 283
10.3 Summary 284
11th Dom Extension 286
11.1 Selector API 286
11.1.1 Queryselector () method 286
11.1.2 Queryselectorall ()
Method 287
11.1.3 Matchesselector ()
Method 288
11.2 Element Traversal 288
11.3 HTML5 289
11.3.1 class-related extensions 289
11.3.2 Focus Management 291
Changes in 11.3.3 HTMLDocument 292
11.3.4 Character Set Property 293
11.3.5 Customizing data Properties 293
11.3.6 Insertion Mark 294
11.3.7 scrollIntoView () method 298
11.4 Proprietary Extensions 298
11.4.1 Document Mode 298
11.4.2 Children Property 299
11.4.3 contains () method 300
11.4.4 Inserting text 301
11.4.5 Scrolling 303
11.5 Summary 304
12th Chapter DOM2 and DOM3 305
12.1 Dom Change 305
12.1.1 changes to the XML namespace 306
12.1.2 other aspects of the change 309
12.2 Style 312
12.2.1 styles for accessing elements 313
12.2.2 Operating style sheet 317
12.2.3 Element Size 320
12.3 Traversal 326
12.3.1 Nodeiterator 328
12.3.2 TreeWalker 330
12.4 Range 332
12.4.1 Range 332 in the DOM
Scopes in 12.4.2 IE8 and earlier versions 340
12.5 Summary 343
Chapter 13th event 345
13.1 Event Stream 345
13.1.1 Event Bubbling 346
13.1.2 Event Capture 346
13.1.3 DOM Event Stream 347
13.2 Event Handlers 348
13.2.1 HTML Event handlers 348
13.2.2 DOM0 Level Event handler 350
13.2.3 DOM2 Level Event handler 351
13.2.4 IE Event Handlers 352
13.2.5 cross-browser event handlers 353
13.3 Event Object 355
13.3.1 Event objects in the DOM 355
13.3.2 Event Object 358 in IE
13.3.3 cross-Browser Event object 360
13.4 Event Type 362
13.4.1 UI Event 362
13.4.2 Focus Event 367
13.4.3 Mouse and Wheel events 368
13.4.4 Keyboard and Text events 379
13.4.5 Composite Event 384
13.4.6 Change Event 385
13.4.7 HTML5 Event 388
13.4.8 Device Event 395
13.4.9 Touch and Gesture events 399
13.5 Memory and Performance 402
13.5.1 Event Delegate 402
13.5.2 removing event handlers 404
13.6 Analog Events 405
13.6.1 event simulations in the DOM 405
13.6.2 event Simulation in IE 410
13.7 Summary 411
14th Form Script 412
14.1 Basics of Forms 412
14.1.1 Submit Form 413
14.1.2 Resetting a form 414
14.1.3 form Fields 414
14.2 text Box Script 419
14.2.1 Selecting text 420
14.2.2 Filter Input 423
14.2.3 Auto Switch Focus 426
14.2.4 HTML5 constraint Validation API 427
14.3 selection Box Script 431
14.3.1 Select option 432
14.3.2 Adding options 434
14.3.3 Removing Options 435
14.3.4 move and rearrange options 435
14.4 Serialization of Forms 436
14.5 Rich Text editing 438
14.5.1 using contenteditable
Property 438
14.5.2 Manipulating Rich Text 439
14.5.3 Rich Text Selection 441
14.5.4 form with rich text 443
14.6 Summary 443
15th. Using Canvas Drawing 445
15.1 Basic Usage 445
15.2 2D Context 446
15.2.1 fills and strokes 446
15.2.2 Drawing a rectangle 447
15.2.3 Drawing a path 449
15.2.4 Drawing Text 451
15.2.5 Transform 453
15.2.6 Drawing an image 456
15.2.7 Shadow 457
15.2.8 Gradient 458
15.2.9 Mode 460
15.2.10 using image Data 460
15.2.11 Synthesis 462
15.3 WebGL 463
15.3.1 typed array 463
15.3.2 WEBGL Context 468
15.3.3 Support 478
15.4 Summary 478
16th Chapter HTML5 Scripting 480
16.1 Cross-Document message delivery 480
16.2 Native drag and drop 481
16.2.1 drag-and-drop event 482
16.2.2 Custom Drop Target 482
16.2.3 DataTransfer Object 483
16.2.4 DropEffect and effectallowed 484
16.2.5 can be dragged 485
16.2.6 other Members 485
16.3 Media Elements 486
16.3.1 Property 487
16.3.2 Event 488
16.3.3 Custom Media Player 488
16.3.4 Detection codec support 489
16.3.5 Audio Type 490
16.4 Historical State Management 491
16.5 Summary 492
17th. Error handling and debugging 493
17.1 Browser reported error 493
17.1.1 IE 493
17.1.2 Firefox 494
17.1.3 Safari 496
17.1.4 Opera 497
17.1.5 Chrome 498
17.2 Error Handling 499
17.2.1 Try-catch Statement 500
17.2.2 Throw error 503
17.2.3 Error Event 505
17.2.4 Strategies for handling Errors 506
17.2.5 Common error Types 507
17.2.6 distinguish between fatal and non-fatal
Error 510
17.2.7 logging errors to server 511
17.3 Commissioning Technology 512
17.3.1 logging messages to the console 512
17.3.2 logging messages to the current page 515
17.3.3 Throw Error 515
17.4 Common IE Error 516
17.4.1 Operation Termination 516
17.4.2 Invalid character 518
17.4.3 member not found 518
17.4.4 Unknown run-time error 519
17.4.5 syntax error 519
17.4.6 system cannot find the specified resource 519
17.5 Summary 520
Chapter 18th JavaScript and XML 521
18.1 browser support for XML DOM 521
18.1.1 DOM2 Class Core 521
18.1.2 Domparser Type 522
18.1.3 XmlSerializer Type 523
18.1.4 in IE8 and previous versions of XML 523
18.1.5 working with XML 527 across browsers
18.2 browser support for XPath 529
18.2.1 DOM3 Level XPath 529
18.2.2 XPath 534 in IE
18.2.3 using XPath 535 across browsers
18.3 browser support for XSLT 537
18.3.1 XSLT 537 in IE
18.3.2 xsltprocessor Type 541
18.3.3 using XSLT 543 across browsers
18.4 Summary 544
19th Chapter E4X 546
19.1 type of e4x 546
19.1.1 XML Type 546
19.1.2 xmllist Type 547
19.1.3 namespace Type 548
19.1.4 QName Type 549
19.2 General Usage 550
19.2.1 Access features 551
19.2.2 Other node types 552
19.2.3 Query 553
19.2.4 building and manipulating XML 555
19.2.5 parsing and serialization 557
19.2.6 namespace 558
19.3 Other changes 559
19.4 Full enablement e4x 560
19.5 Summary 561
20th Chapter JSON 562
20.1 Syntax 562
20.1.1 Simple Value 562
20.1.2 Object 563
20.1.3 Array 564
20.2 parsing and serialization 565
20.2.1 JSON Object 565
20.2.2 Serialization Options 566
20.2.3 Parsing Options 569
20.3 Summary 570
Chapter 21st Ajax and Comet 571
21.1 XMLHttpRequest Object 571
Usage of 21.1.1 XHR 573
21.1.2 HTTP Header Information 575
21.1.3 GET request 576
21.1.4 POST Request 577
21.2 XMLHttpRequest 2 level 578
21.2.1 FormData 578
21.2.2 Timeout Setting 579
21.2.3 Overridemimetype ()
Method 580
21.3 Progress Events 580
21.3.1 Load Event 580
21.3.2 Progress Event 581
21.4 cross-origin resource sharing 582
21.4.1 IE's implementation of cors 582
21.4.2 other browsers to Cors
Implementation 584
21.4.3 preflighted reqeusts 584
21.4.4 Request with credentials 585
21.4.5 Cross-browser cors 585
21.5 other cross-domain technologies 586
21.5.1 Image Ping 586
21.5.2 JSONP 587
21.5.3 Comet 588
21.5.4 server sends event 590
21.5.5 Web Sockets 591
21.5.6 SSE and Web Sockets 593
21.6 Safety 593
21.7 Summary 594
22nd Advanced Tips 596
22.1 Advanced Functions 596
22.1.1 Safe Type Detection 596
22.1.2 scope-Safe constructors 597
22.1.3 Lazy Load Function 600
22.1.4 Function Binding 602
22.1.5 function of Curry 604
22.2 Tamper-resistant Objects 606
22.2.1 non-expandable object 606
22.2.2 Sealed Objects 607
22.2.3 Frozen Objects 608
22.3 Advanced Timer 609
22.3.1 Repeat Timer 610
22.3.2 yielding Processes 612
22.3.3 Function Throttle 614
22.4 Custom Event 616
22.5 Drag and drop 618
22.5.1 Repair Drag function 620
22.5.2 Adding custom Events 622
22.6 Summary 624
The 23rd Chapter offline application and client storage 626
23.1 Offline detection 626
23.2 Application Cache 627
23.3 Data Storage 628
23.3.1 Cookie 629
23.3.2 IE User Data 637
23.3.3 Web Storage mechanism 638
23.3.4 IndexedDB 643
23.4 Summary 654
Chapter 24th Best Practices 656
24.1 serviceability 656
24.1.1 What is a maintainable code 656
24.1.2 Code Contract 657
24.1.3 Loose Coupling 659
24.1.4 Programming Practice 662
24.2 Performance 666
24.2.1 Note Scope 666
24.2.2 choosing the right method 667
24.2.3 minimum number of statements 672
24.2.4 Optimizing DOM Interaction 673
24.3 Deployment of 676
24.3.1 Build Process 676
24.3.2 Verification 677
24.3.3 Compression 679
24.4 Summary 681
25th Chapter Emerging API 682
25.1 Requestanimationframe () 682
25.1.1 Early Animation cycle 682
25.1.2 Cycle interval Problem 683
25.1.3 Mozrequestanimation-frame 683
25.1.4 Webkitrequestanima-tionframe and Msrequest-animationframe 685
25.2 Page Visibility API 686
25.3 geolocation API 687
25.4 File API 689
25.4.1 FileReader Type 690
25.4.2 reading part of content 692
25.4.3 Object URL 693
25.4.4 reading drag-and-drop files 694
25.4.5 uploading files using XHR 695
25.5 Web Timing 696
25.6 Web Workers 697
25.6.1 using worker 697
25.6.2 Worker Global Scope 698
25.6.3 contains additional scripts 699
25.6.4 the future of WEB workers 700
25.7 Summary 700
Appendix A ECMAScript Harmony 701
Appendix B Strict Mode 717
Appendix C JavaScript Library 723
Appendix D JavaScript Tools 727

: Network Disk Download

JavaScript Advanced Programming (3rd edition) pdf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.