E-book : Professional jQuery for free
E-book : Professional jQuery for free
CHAPTER 1: GETTING STARTED
What jQuery Is Good At 3
Hardware and Browser Requirements 4
Obtaining jQuery and jQuery UI 4
“Hello World” Example 5
JavaScript Conventions Used in This Book 6
Development Tools 9
Debugging JavaScript and jQuery 15
Using the FireQuery Plugin 16
Summary 17
CHAPTER 2: JAVASCRIPT PRIMER
Understanding Numbers 20
Working with Strings 21
Understanding Booleans 21
Comparison Types 22
A Brief Note About Dates 23
Reviewing Miscellaneous Types 23
Revisiting Variables 24
Understanding Objects 25
Using Functions 29
Understanding Execution Context 32
Working with Scope and Closures 32
Understanding Access Levels 34
Applying Modules 34
Using JavaScript Arrays 35
Augmenting Types 37
Applying JS Best Practices 38
Putting It All Together 38
Summary 39
Note 39
CHAPTER 3: THE JQUERY CORE
Understanding the Structure of a jQuery Script 41
Utility Functions 43
Using JavaScript Unobtrusively 52
The jQuery Framework Structure 58
Understanding the DOM and Events 60
Using jQuery with Other JavaScript Libraries 60
Summary 61
Notes 62
CHAPTER 4: DOM ELEMENT SELECTION AND MANIPULATION
The Power of jQuery Selectors 64
Selecting Elements 64
Selecting by CSS Styles 66
Selecting by Attributes 68
Selecting by Position 72
Using Filter Selectors 72
Custom User Selectors 81
Doing DOM Traversal 82
Accessing and Modifying Elements,
Attributes, and Content 88
Working with Content 88
Generating HTML 92
Summary 93
CHAPTER 5: EVENT HANDLING
Understanding the Browser Event Model 96
Event Capturing and Bubbling 99
Understanding How jQuery Handles Events 101
Applying jQuery Event Handlers 103
Working with Events 108
jQuery’s New Event API 114
Summary 116
Notes 117
CHAPTER 6: HTML FORMS, DATA, AND AJAX
jQuery Data Appreciation 119
Using Form Validations 121
Feature Detection with Modernizr
Working with HTML Form Elements 124
Revisiting Ajax Basics 127
Applying Ajax with jQuery 129
Summary 138
Notes 138
CHAPTER 7: ANIMATIONS AND EFFECTS
Animating Elements 141
Animating CSS Properties 143
Resizing Elements 146
Designing Custom Animations 146
Animations with HTML5 Canvas 150
Summary 152
Notes 152
PART II: APPLIED JQUERY
CHAPTER 8: JQUERY UI PART I—MAKING THINGS
LOOK SLICK 155
Theming and Styling 155
Using ThemeRoller 156
Using jQuery UI Widgets 157
Button 158
Tabs 159
Accordion 163
Autocomplete 164
Datepicker 167
Dialog 173
Progressbar 175
Slider 176
Summary 178
Notes 178
CHAPTER 9: JQUERY UI PART II—MOUSE INTERACTIONS
Dragging and Dropping 179
Sorting 184
Resizing Elements 188
Making Elements Selectable 192
Summary
CHAPTER 10: WRITING EFFECTIVE JQUERY CODE
Optimization Techniques 195
Minimize DOM Updates 196
More Eff ective Looping 198
Caching Objects 200
Use Effi cient Selectors 200
Consider Skipping jQuery Methods Entirely 204
DRY 205
Use JavaScript Patterns 206
Creating an Application Namespace with a Singleton 207
The Module Pattern 210
The Garber-Irish Implementation 213
Using $.data() 216
The Basics of the .data() API 216
Fully Leveraging the Data API 217
Summary 219
CHAPTER 11: JQUERY TEMPLATES
Taming a Tangle of Strings 221
Separation of Content and Behavior 223
Code Reuse 223
Aesthetics and Clarity 223
The Past, Present, and Future of jQuery Templates 223
Creating Templates 224
Applying Templates with $.tmpl() 226
Applying Templates Using Remote Data 228
Template Tags 230
Summary 240
CHAPTER 12: WRITING JQUERY PLUGINS
The Plugin Basics 241
Applying jQuery Plugin Naming Conventions 242
How to Extend jQuery 242
General Plugin Guidelines 244
Applying Plugin Best Practices 249
Utilize and Learn from Existing Plugin Patterns 256
A Closer Look at the Widget Factory 258
An Example Plugin Implementation 259
Summary
CHAPTER 13: ADVANCED ASYNCHRONOUS PROGRAMMING WITH
JQUERY DEFERRED
Building Blocks 263
Promises 264
The Promises/A Proposal 264
The jQuery Deferred Object 265
Summary 279
CHAPTER 14: UNIT TESTING WITH QUNIT
An Introduction to Unit Testing 281
What Is Unit Testing? 282
Benefi ts of Unit Testing 282
Test-Driven Development 283
Understanding What Makes a Good Unit Test 283
Getting Started with QUnit 284
The QUnit Hello World Using equal 284
A Failing QUnit Test 286
Testing for Truthiness with ok 287
Setting Expectations 287
Additional Assertions 288
Testing DOM Elements 289
Using noglobals and notrycatch 290
Organizing Tests into Modules 292
Asynchronous Testing 294
Using asyncTest 295
Mocking Ajax Requests 296
Putting it All Together in a Test Suite
E-book : Professional jQuery for free
0 commentaires: