Packt Publishing AJAX and PHP, Building Responsive Web Applications (2006).pdf
(
3780 KB
)
Pobierz
AJAX and PHP
Building Responsive Web Applications
Enhance the user experience of your PHP website
using AJAX with this practical tutorial featuring detailed
case studies
Cristian Darie
Bogdan Brinzarea
Filip Cherecheş-Toşa
Mihai Bucica
BIRMINGHAM - MUMBAI
AJAX and PHP
Building Responsive Web Applications
Copyright © 2006 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the publisher,
except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without warranty,
either express or implied. Neither the authors, Packt Publishing, nor its dealers or distributors will
be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the companies and
products mentioned in this book by the appropriate use of capitals. However, Packt Publishing
cannot guarantee the accuracy of this information.
First published: March 2006
Production Reference: 1210206
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 1-904811-82-5
www.packtpub.com
Cover Design by
www.visionwt.com
Table of Contents
Preface
1
Chapter 1: AJAX and the Future of Web Applications
7
8
Delivering Functionality via the Web
9
Advantages of Web Applications
10
Building Websites Since 1990
10
HTTP and HTML
11
PHP and Other Server-Side Technologies
JavaScript and Other Client-Side Technologies
12
13
What's Been Missing?
14
Understanding AJAX
Building a Simple Application with AJAX and PHP
18
Time for Action—Quickstart AJAX
21
28
Summary
Chapter 2: Client-Side Techniques with Smarter JavaScript
29
JavaScript and the Document Object Model
30
Time for Action—Playing with JavaScript and the DOM
32
JavaScript Events and the DOM
33
Time for Action—Using JavaScript Events and the DOM
35
Even More DOM
37
Time for Action—Even More DOM
37
JavaScript, DOM, and CSS
39
Time for Action—Working with CSS and JavaScript
39
42
Using the XMLHttpRequest Object
43
Creating the XMLHttpRequest Object
45
Creating Better Objects for Internet Explorer
46
Initiating Server Requests Using XMLHttpRequest
Handling Server Response
49
Time for Action—Making Asynchronous Calls with XMLHttpRequest
50
Table of Contents
Working with XML Structures 55
Time for Action—Making Asynchronous Calls with XMLHttpRequest and XML 55
Handling More Errors and Throwing Exceptions
59
63
Creating XML Structures
64
Summary
Chapter 3: Server-Side Techniques with PHP and MySQL
65
PHP and DOM
65
Time for Action—Doing AJAX with PHP
66
Passing Parameters and Handling PHP Errors
71
Time for Action—Passing PHP Parameters and Error Handling
72
Connecting to Remote Servers and JavaScript Security
79
Time for Action—Connecting to Remote Servers
81
Using a Proxy Server Script
85
Time for Action—Using a Proxy Server Script to Access Remote Servers
86
A Framework for Making Repetitive Asynchronous Requests
91
Time for Action—Implementing Repetitive Tasks
93
101
Working with MySQL
101
Creating Database Tables
Manipulating Data
104
Connecting to Your Database and Executing Queries
105
Time for Action—Working with PHP and MySQL
106
Wrapping Things Up and Laying Out the Structure
109
Time for Action—Building the Friendly Application
112
Summary
119
Chapter 4: AJAX Form Validation
121
122
Implementing AJAX Form Validation
Thread-Safe AJAX
125
Time for Action—AJAX Form Validation
126
144
Summary
Chapter 5: AJAX Chat
145
145
Introducing AJAX Chat
Implementing AJAX Chat
147
Time for Action—Ajax Chat
148
164
Summary
ii
Table of Contents
Chapter 6: AJAX Suggest and Autocomplete
165
Introducing AJAX Suggest and Autocomplete
165
166
Google Suggest
Implementing AJAX Suggest and Autocomplete
167
Time for Action—AJAX Suggest and Autocomplete
168
188
Summary
Chapter 7: AJAX Real-Time Charting with SVG
189
Implementing a Real-Time Chart with AJAX and SVG
190
Time for Action—Building the Real-Time SVG Chart
193
Summary
202
Chapter 8: AJAX Grid
203
Implementing the AJAX Grid Using Client-Side XSLT
204
Time for Action—AJAX Grid
205
221
Summary
Chapter 9: AJAX RSS Reader
223
Working with RSS
223
224
The RSS Document Structure
224
Google Reader
Implementing the AJAX RSS Reader
225
Time for Action—Building the RSS Reader Application
226
236
Summary
Chapter 10: AJAX Drag and Drop
237
237
Using Drag and Drop on the Web
237
Shopping Carts
238
Sortable Lists
Building the AJAX Drag-and-Drop Sortable List Application
238
Time for Action—Task Management Application with AJAX
241
253
Summary
Appendix A: Preparing Your Working Environment
255
256
Preparing Your Windows Playground
256
Installing Apache
258
Installing MySQL
Installing PHP
259
iii
Plik z chomika:
krupix.one
Inne pliki z tego folderu:
Apress Foundation PHP 5 for Flash (2005).pdf
(29809 KB)
Apress Beginning Google Maps Applications with PHP and Ajax, From Novice to Professional (2006).pdf
(15742 KB)
Apress Beginning PHP and PostgreSQL 8, From Novice to Professional (2006).pdf
(17128 KB)
Apress Building Online Communities with Drupal, phpBB and WordPress (2006).pdf
(14661 KB)
Apress Beginning CakePHP, From Novice to Professional (2008).pdf
(3856 KB)
Inne foldery tego chomika:
Android Application Development Video Guide Poradnik
Apple iOS 5 and 6 Development eBooks Collection [PDF]
ASP.NET eBooks Collection [PDF]
books
Complete IT Books Pack
Zgłoś jeśli
naruszono regulamin