About the Authors |
|
xiii | |
About the Technical Reviewer |
|
xv | |
|
Part 1 Getting Comfortable with jQuery |
|
|
1 | (82) |
|
Chapter 1 Introducing jQuery |
|
|
3 | (22) |
|
Choosing jQuery Over JavaScript |
|
|
3 | (1) |
|
Understanding JavaScript Libraries |
|
|
3 | (1) |
|
Understanding the Benefits of jQuery |
|
|
4 | (1) |
|
Understanding the History of jQuery |
|
|
4 | (1) |
|
Setting Up a Testing Environment |
|
|
4 | (3) |
|
|
5 | (1) |
|
|
5 | (2) |
|
Including jQuery in Web Pages |
|
|
7 | (1) |
|
Including a Downloaded Copy of the jQuery Library |
|
|
7 | (1) |
|
Including a Remotely Hosted Copy of the jQuery Library |
|
|
8 | (1) |
|
|
8 | (15) |
|
Introducing the jQuery Function |
|
|
9 | (1) |
|
Selecting DOM Elements Using CSS Syntax |
|
|
9 | (14) |
|
|
23 | (2) |
|
Chapter 2 Common jQuery Actions and Methods |
|
|
25 | (58) |
|
Understanding the Basic Behavior of jQuery Scripts |
|
|
25 | (1) |
|
Understanding jQuery Methods |
|
|
25 | (57) |
|
|
26 | (10) |
|
Creating and Inserting DOM Elements |
|
|
36 | (16) |
|
Accessing and Modifying CSS and Attributes |
|
|
52 | (9) |
|
|
61 | (3) |
|
Using Animation and Other Effects |
|
|
64 | (6) |
|
|
70 | (6) |
|
|
76 | (6) |
|
|
82 | (1) |
|
Part 2 Getting Into Advanced PHP Programming |
|
|
83 | (146) |
|
Chapter 3 Object-Oriented Programming |
|
|
85 | (30) |
|
Understanding Object-Oriented Programming |
|
|
85 | (1) |
|
Understanding Objects and Classes |
|
|
85 | (25) |
|
Recognizing the Differences Between Objects and Classes |
|
|
85 | (1) |
|
|
86 | (1) |
|
Defining Class Properties |
|
|
87 | (1) |
|
|
88 | (9) |
|
|
97 | (4) |
|
Assigning the Visibility of Properties and Methods |
|
|
101 | (7) |
|
Commenting with DocBlocks |
|
|
108 | (2) |
|
Comparing Object-Oriented and Procedural Code |
|
|
110 | (4) |
|
|
110 | (4) |
|
|
114 | (1) |
|
|
114 | (1) |
|
|
114 | (1) |
|
Chapter 4 Build an Events Calendar |
|
|
115 | (46) |
|
|
115 | (5) |
|
Defining the Database Structure |
|
|
115 | (1) |
|
|
115 | (1) |
|
Planning the Application's Folder Structure |
|
|
116 | (2) |
|
Modifying the Development Environment |
|
|
118 | (2) |
|
|
120 | (40) |
|
|
120 | (1) |
|
Connecting to the Database with a Class |
|
|
121 | (2) |
|
Creating the Class Wrapper |
|
|
123 | (1) |
|
|
123 | (2) |
|
|
125 | (6) |
|
|
131 | (7) |
|
Outputting HTML to Display the Calendar and Events |
|
|
138 | (17) |
|
Outputting HTML to Display Full Event Descriptions |
|
|
155 | (5) |
|
|
160 | (1) |
|
Chapter 5 Add Controls to Create, Edit, and Delete Events |
|
|
161 | (34) |
|
Generating a Form to Create or Edit Events |
|
|
161 | (9) |
|
Adding a Token to the Form |
|
|
164 | (1) |
|
Creating a File to Display the Form |
|
|
165 | (2) |
|
Adding a New Stylesheet for Administrative Features |
|
|
167 | (3) |
|
Saving New Events in the Database |
|
|
170 | (10) |
|
Adding a Processing File to Call the Processing Method |
|
|
173 | (3) |
|
Adding a Button to the Main View to Create New Events |
|
|
176 | (4) |
|
Adding Edit Controls to the Full Event View |
|
|
180 | (5) |
|
Modifying the Full Event Display Method to Show Admin Controls |
|
|
182 | (1) |
|
Adding the Admin Stylesheet to the Full Event View Page |
|
|
183 | (2) |
|
|
185 | (8) |
|
Generating a Delete Button |
|
|
186 | (1) |
|
Creating a Method to Require Confirmation |
|
|
187 | (3) |
|
Creating a File to Display the Confirmation Form |
|
|
190 | (3) |
|
|
193 | (2) |
|
Chapter 6 Password Protecting Sensitive Actions and Areas |
|
|
195 | (34) |
|
Building the Admin Table in the Database |
|
|
195 | (1) |
|
Building a File to Display a Login Form |
|
|
196 | (2) |
|
|
198 | (17) |
|
|
198 | (1) |
|
Building a Method to Check the Login Credentials |
|
|
199 | (10) |
|
Modifying the App to Handle the Login Form Submission |
|
|
209 | (6) |
|
Allowing the User to Log Out |
|
|
215 | (6) |
|
Adding a Log Out Button to the Calendar |
|
|
215 | (1) |
|
Creating a Method to Process the Logout |
|
|
216 | (1) |
|
Modifying the App to Handle the User Logout |
|
|
217 | (4) |
|
Displaying Admin Tools Only to Administrators |
|
|
221 | (7) |
|
Showing Admin Options to Administrators |
|
|
221 | (4) |
|
Limiting Access to Administrative Pages |
|
|
225 | (3) |
|
|
228 | (1) |
|
Part 3 Combining jQuery with PHP Applications |
|
|
229 | (80) |
|
Chapter 7 Enhancing the User Interface with jQuery |
|
|
231 | (30) |
|
Adding Progressive Enhancements with jQuery |
|
|
231 | (1) |
|
Setting Progressive Enhancement Goals |
|
|
232 | (1) |
|
Including jQuery in the Calendar App |
|
|
232 | (4) |
|
Creating a JavaScript Initialization File |
|
|
232 | (1) |
|
Creating a New Stylesheet for Elements Created by jQuery |
|
|
233 | (3) |
|
Creating a Modal Window for Event Data |
|
|
236 | (23) |
|
Binding a Function to the Click Event of Title Links |
|
|
236 | (1) |
|
Preventing the Default Action and Adding an Active Class |
|
|
236 | (1) |
|
Extracting the Query String with Regular Expressions |
|
|
237 | (2) |
|
|
239 | (5) |
|
Retrieving and Displaying Event Information with AJAX |
|
|
244 | (5) |
|
|
249 | (2) |
|
Adding Effects to the Creation and Destruction of the Modal Window |
|
|
251 | (8) |
|
|
259 | (2) |
|
Chapter 8 Editing the Calendar with AJAX and jQuery |
|
|
261 | (48) |
|
Opening the Event Creation Form |
|
|
261 | (6) |
|
Adding an AJAX Call to Load the Form |
|
|
262 | (2) |
|
Modifying the AJAX Processing File to Load the Form |
|
|
264 | (2) |
|
Making the Cancel Button Behave Like the Close Button |
|
|
266 | (1) |
|
Saving New Events in the Database |
|
|
267 | (5) |
|
Modifying the AJAX Processing File to Handle New Submissions |
|
|
270 | (2) |
|
Adding Events Without Refreshing |
|
|
272 | (16) |
|
Deserializing the Form Data |
|
|
273 | (4) |
|
|
277 | (4) |
|
Appending the Event to the Calendar |
|
|
281 | (3) |
|
Getting the New Event's Correct ID |
|
|
284 | (4) |
|
Editing Events in a Modal Window |
|
|
288 | (9) |
|
Determining the Form Action |
|
|
289 | (1) |
|
Storing the Event ID if One Exists |
|
|
290 | (2) |
|
Removing Event Data from the Modal Window |
|
|
292 | (2) |
|
Ensuring Only New Events Are Added to the Calendar |
|
|
294 | (3) |
|
Confirming Deletion in a Modal Window |
|
|
297 | (11) |
|
Displaying the Confirmation Dialog |
|
|
298 | (2) |
|
Configuring the Form Submission Event Handler for Deletion |
|
|
300 | (5) |
|
Removing the Event from the Calendar After Deletion |
|
|
305 | (3) |
|
|
308 | (1) |
|
Part 4 Advancing jQuery and PHP |
|
|
309 | (50) |
|
Chapter 9 Performing Form Validation with Regular Expressions |
|
|
311 | (32) |
|
Getting Comfortable with Regular Expressions |
|
|
311 | (16) |
|
Understanding Basic Regular Expression Syntax |
|
|
311 | (5) |
|
Drilling Down on the Basics of Pattern Modifiers |
|
|
316 | (2) |
|
Getting Fancy with Backreferences |
|
|
318 | (2) |
|
Matching Character Classes |
|
|
320 | (3) |
|
|
323 | (1) |
|
Using Repetition Operators |
|
|
323 | (1) |
|
Detecting the Beginning or End of a String |
|
|
324 | (1) |
|
|
324 | (1) |
|
|
325 | (1) |
|
|
325 | (2) |
|
Adding Server-Side Date Validation |
|
|
327 | (1) |
|
Defining the Regex Pattern to Validate Dates |
|
|
328 | (1) |
|
|
328 | (10) |
|
|
329 | (3) |
|
Adding a Validation Method to the Calendar Class |
|
|
332 | (2) |
|
Returning an Error if the Dates Don't Validate |
|
|
334 | (4) |
|
Adding Client-Side Date Validation |
|
|
338 | (4) |
|
Creating a New JavaScript File to Validate the Date String |
|
|
338 | (1) |
|
Including the New File in the Footer |
|
|
338 | (1) |
|
Preventing the Form Submission if Validation Fails |
|
|
339 | (3) |
|
|
342 | (1) |
|
Chapter 10 Extending jQuery |
|
|
343 | (16) |
|
Adding Functions to jQuery |
|
|
343 | (5) |
|
Adding Your Date Validation Function to jQuery |
|
|
343 | (3) |
|
Modifying the Include Script |
|
|
346 | (1) |
|
Modifying the Initialization Script |
|
|
346 | (2) |
|
|
348 | (10) |
|
|
349 | (6) |
|
Implementing Your Plug-in |
|
|
355 | (3) |
|
|
358 | (1) |
|
Appendix A Brief Notes on PHP 7 |
|
|
359 | (8) |
|
|
359 | (2) |
|
|
361 | (1) |
|
|
362 | (1) |
|
|
363 | (1) |
|
|
364 | (1) |
|
|
364 | (3) |
Index |
|
367 | |