Written in Packt's cookbook style, this book presents numerous practical examples that you can use directly in your applications. The book covers most of the essential issues you will face while developing your web applications and gives solutions to them. Recipes in the book are written in a manner that will rapidly take you from a beginner to expert level. If you want to use PHP and jQuery together to create web applications this book is for you. It provides a large number of examples in each chapter that will take you from a basic developer to a pro by giving step-by-step instructions for each task in developing web applications using PHP and jQUery. All you need are JavaScript basics and you are on your way to building power web applications, with this book in hand.
Author(s): Vijay Joshi
Publisher: Packt Publishing
Year: 2010
Language: English
Pages: 332
Cover......Page 1
Copyright......Page 3
Credits......Page 4
About the Author......Page 5
About the Reviewers......Page 6
Table of Contents......Page 10
Preface......Page 14
Introduction......Page 20
Executing functions when page has loaded......Page 21
Binding and unbinding elements......Page 22
Adding events to elements that will be created later......Page 27
Submitting a form with jQuery......Page 29
Checking for missing images......Page 31
Creating the select/unselect all checkboxes functionality......Page 34
Capturing mouse events......Page 38
Creating keyboard shortcuts......Page 41
Displaying user selected text......Page 44
Dragging elements on a page......Page 49
Introduction......Page 54
Fetching data from PHP using jQuery......Page 56
Creating a query string automatically for all form elements......Page 60
Detecting an AJAX request in PHP......Page 63
Sending data to PHP......Page 65
Aborting AJAX requests......Page 69
Creating an empty page and loading it in parts......Page 72
Handling errors in AJAX requests......Page 76
Preventing browser from caching AJAX requests......Page 80
Loading JavaScript on demand to reduce page load time......Page 81
Introduction......Page 86
Loading XML from files and strings using SimpleXML......Page 89
Accessing elements and attributes using SimpleXML......Page 92
Searching elements using XPath......Page 96
Reading an XML using DOM extension......Page 101
Creating an XML using DOM extension......Page 105
Modifying an XML using DOM extension......Page 107
Parsing XML with jQuery......Page 111
Introduction......Page 116
Creating JSON in PHP......Page 118
Reading JSON in PHP......Page 120
Catching JSON parsing errors......Page 122
Accessing data from a JSON in jQuery......Page 125
Introduction......Page 132
Adding input fields dynamically in a form......Page 133
Searching for user-inputted string in a page......Page 136
Checking for empty fields using jQuery......Page 140
Validating numbers using jQuery......Page 144
Validating e-mail and website addresses using regular expressions......Page 147
Displaying errors as user types: Performing live validation......Page 151
Strengthening validation: validating again in PHP......Page 156
Creating a voting system......Page 162
Allowing HTML inside text areas and limiting HTML tags that can be used......Page 167
Introduction......Page 172
Creating a Tic-Tac-Toe game with effects......Page 173
Informing a user while an AJAX request is in progress......Page 180
Creating expandable and collapsible boxes (accordion)......Page 185
Fading an element after updating it......Page 190
Floating box on demand......Page 193
Updating items in a shopping cart......Page 197
Introduction......Page 206
Creating a basic drop-down menu......Page 207
Creating a menu that changes background on mouse-over......Page 211
Creating an accordion style menu......Page 213
Creating a floating menu......Page 219
Creating an interface for tabbed navigation......Page 224
Adding more tabs......Page 229
Creating a wizard using tabs......Page 234
Introduction......Page 242
Fetching data from a database and displaying it in a table format......Page 243
Collecting data from a form and saving to a database......Page 249
Filling chained combo boxes that depend upon each other......Page 254
Checking username availability from database......Page 260
Paginating data for large record sets......Page 265
Adding auto-suggest functionality to a textbox......Page 271
Creating a tag cloud......Page 279
Introduction......Page 286
Sending cross-domain requests using server proxy......Page 287
Making cross-domain requests with jQuery......Page 293
Creating an endless scrolling page......Page 299
Creating a jQuery plugin......Page 304
Displaying RSS feeds with jQuery and PHP......Page 309
Introduction......Page 314
Inspecting elements......Page 316
Editing HTML and CSS......Page 318
Debugging JavaScript......Page 320
Index......Page 324