Table of Contents
The Story behind the Succinctly Series of Books................................................................... 8 About the Author...................................................................................................................... 10 Introduction............................................................................................................................... 11 Preface....................................................................................................................................... 12 jQuery semantics..................................................................................................................... 12 How the book is structured...................................................................................................... 12 More code, less words............................................................................................................. 12 Why oh why did I use alert() for code examples?............................................................... 12 Color coding............................................................................................................................. 13 Completely grok jQuery text() before reading this book....................................................... 13 Code examples........................................................................................................................ 14
Chapter 1 Core jQuery.......................................................................................................... 15 Base concept behind jQuery.................................................................................................... 15 The concept, behind the concept, behind jQuery.................................................................... 16 jQuery requires HTML to run in standards mode or almost-standards mode.......................... 16 Waiting on the DOM to be ready............................................................................................. 17 Executing jQuery code when the browser window is completely loaded................................. 17 Include all CSS files before including jQuery........................................................................... 18 Using a hosted version of jQuery............................................................................................. 18 Executing jQuery code when DOM is parsed without using ready()..................................... 19 Grokking jQuery chaining........................................................................................................ 20 Breaking the chain with destructive methods.......................................................................... 21 Using destructive jQuery methods and exiting destruction using end()................................. 21 Aspects of the jQuery function................................................................................................. 22 Grokking when the keyword this refers to DOM elements.................................................... 23 Extracting elements from a wrapper set, using them directly without jQuery.......................... 25 Checking to see if the wrapper set is empty............................................................................ 27 Creating an alias by renaming the jQuery object itself............................................................ 28 Using. each() when implicit iteration is not enough............................................................... 28 Elements in jQuery wrapper set returned in document order.................................................. 31 Determining context used by the jQuery function.................................................................... 31 Creating entire DOM structure, including DOM events, in a single chain................................ 32
Chapter 2 Selecting.............................................................................................................. 34 Custom jQuery filters can select elements when used alone.................................................. 34 Grokking the: hidden and: visible filter.............................................................................. 34
4