04.11.2015 Views

javascript

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents<br />

Chapter 18: Advanced Techniques 589<br />

Advanced Functions 589<br />

Scope-Safe Constructors 589<br />

Lazy Loading Functions 592<br />

Function Binding 594<br />

Function Currying 596<br />

Advanced Timers 598<br />

Repeating Timers 600<br />

Yielding Processes 602<br />

Function Throttling 604<br />

Custom Events 606<br />

Drag-and-Drop 609<br />

Fixing Drag Functionality 611<br />

Adding Custom Events 613<br />

Summary 615<br />

Chapter 19: Client-Side Storage 617<br />

Cookies 617<br />

Restrictions 618<br />

Cookie Parts 618<br />

Cookies in JavaScript 619<br />

Subcookies 622<br />

Cookie Considerations 626<br />

Internet Explorer User Data 627<br />

DOM Storage 628<br />

The Storage Type 628<br />

The sessionStorage Object 629<br />

The globalStorage Object 631<br />

The localStorage Object 632<br />

The StorageItem Type 633<br />

The storage Event 633<br />

Limits and Restrictions 634<br />

Summary 634<br />

Chapter 20: Best Practices 635<br />

Maintainability 635<br />

What is Maintainable Code? 636<br />

Code Conventions 636<br />

Loose Coupling 639<br />

Programming Practices 642<br />

xxiv

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!