Sams Teach Yourself Ajax, JavaScript, and PHP All in One

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

In just a short time, you can learn how to use Ajax, JavaScript, and PHP to create interactive interfaces to your web applications by combining these powerful technologies.   No previous Ajax programming experience is required. Using a straightforward, step-by-step approach, each lesson in this book builds on the previous ones, enabling you to learn the essentials of Ajax programming with JavaScript, PHP, and related technologies from the ground up.   Regardless of whether you run Linux, Windows, or Mac OS X, the enclosed CD includes a complete Ajax programming starter kit that gives you all the programming tools, reference information, JavaScript libraries, and server software you need to set up a stable environment for learning, testing, and production.   Learn how to… Build better, more interactive interfaces for your web applications Make JavaScript, HTML, XML, and PHP work together to create Ajax effects Compile an Ajax application Create and consume web services with SOAP and REST Avoid common errors and troubleshoot programs Use popular Ajax libraries to speed up and improve common programming tasks   On the CD XAMPP for Windows, Mac OS X, and Linux—an easy-to-install package to set up a PHP- and MySQL-enabled Apache server on your computer The jEdit programming editor for Windows, Mac, and Linux Prototype, Scriptaculous, Rico, and XOAD—popular JavaScript libraries for creating Ajax applications and effects A complete Ajax, HTML, XML, and PHP tutorial reference library in searchable PDF format Source code for the examples in the book   Phil Ballard is a software engineering consultant and developer specializing in website and intranet design and development for an international portfolio of clients. He has an honors degree from the University of Leeds, England, and has worked for several years in commercial and managerial roles in the high technology sector.   Michael Moncur is a freelance webmaster and author. He runs a network of websites and has written several bestselling books about web development, networking, certification programs, and databases.   Category: Web Development Covers: Ajax, JavaScript and PHP User Level: Beginning–Intermediate 

Author(s): Phil Ballard, Michael Moncur
Edition: 1
Publisher: Sams Publishing
Year: 2008

Language: English
Pages: 384

Sams Teach Yourself Ajax, JavaScript, and PHP All in One......Page 1
Table of Contents......Page 7
Introduction......Page 17
Part I: Web Basics Refresher......Page 23
A Short History of the Internet......Page 25
The World Wide Web......Page 26
Introducing HTTP......Page 30
The HTTP Request and Response......Page 31
HTML Forms......Page 33
Summary......Page 36
Introducing HTML......Page 37
Elements of an HTML Page......Page 39
A More Advanced HTML Page......Page 43
Some Useful HTML Tags......Page 45
Adding Your Own Style......Page 46
Add a Little class......Page 47
Applying Styles......Page 49
Formatting Text with Styles......Page 51
Adding Lines......Page 55
Summary......Page 56
The Need for Ajax......Page 57
Introducing Ajax......Page 59
The Constituent Parts of Ajax......Page 61
Putting It All Together......Page 63
Summary......Page 65
Part II: Introducing Web Scripting with JavaScript......Page 67
Tools for Scripting......Page 69
Displaying Time with JavaScript......Page 70
Adding JavaScript Statements......Page 71
Creating Output......Page 72
Adding the Script to a Web Page......Page 73
Testing the Script......Page 74
JavaScript Syntax Rules......Page 81
Using Comments......Page 82
Best Practices for JavaScript......Page 83
Summary......Page 85
Understanding Objects......Page 87
Understanding the Document Object Model (DOM)......Page 88
Working with Web Documents......Page 90
Accessing Browser History......Page 93
Working with the location Object......Page 94
Summary......Page 96
Using Variables......Page 97
Understanding Expressions and Operators......Page 101
Data Types in JavaScript......Page 102
Converting Between Data Types......Page 104
Using String Objects......Page 105
Working with Substrings......Page 108
Using Numeric Arrays......Page 110
Using String Arrays......Page 112
Sorting a Numeric Array......Page 114
Summary......Page 117
Using Functions......Page 119
Introducing Objects......Page 124
Using Objects to Simplify Scripting......Page 125
Extending Built-in Objects......Page 128
Summary......Page 131
CHAPTER 8: Controlling Flow with Conditions and Loops......Page 133
The if Statement......Page 134
Using Shorthand Conditional Expressions......Page 137
Testing Multiple Conditions with if and else......Page 138
Using Multiple Conditions with switch......Page 140
Using for Loops......Page 141
Using do…while Loops......Page 144
Working with Loops......Page 145
Looping Through Object Properties......Page 147
Summary......Page 150
Using the Math Object......Page 151
Working with Math Functions......Page 153
Using the with Keyword......Page 155
Working with Dates......Page 156
Using Third-Party Libraries......Page 159
Other Libraries......Page 160
Summary......Page 161
Part III: Introducing Ajax......Page 163
Introducing XMLHTTPRequest......Page 165
Creating the XMLHTTPRequest Object......Page 166
Summary......Page 172
Sending the Server Request......Page 173
Monitoring Server Status......Page 178
The Callback Function......Page 179
Summary......Page 182
The responseText and responseXML Properties......Page 183
Parsing responseXML......Page 187
Providing User Feedback......Page 188
Summary......Page 190
Constructing the Ajax Application......Page 191
The HTML Document......Page 192
Adding JavaScript......Page 193
Putting It All Together......Page 196
Summary......Page 200
Part IV: Server-side Scripting with PHP......Page 201
PHP Basics......Page 203
Your First PHP Script......Page 206
Summary......Page 210
Understanding Variables......Page 211
Data Types......Page 213
Working with Numbers......Page 214
Numeric Functions......Page 216
Working with Strings......Page 218
Formatting Strings......Page 219
String Functions......Page 221
Working with Arrays......Page 222
Array Functions......Page 224
Date Formats......Page 225
Working with Timestamps......Page 226
Summary......Page 229
Conditional Statements......Page 231
Loops......Page 236
Summary......Page 238
Using Functions......Page 239
Arguments and Return Values......Page 241
Summary......Page 245
Object-Oriented PHP......Page 247
What Is a Class?......Page 248
Creating and Using Objects......Page 249
Summary......Page 252
Part V: More Complex Ajax Technologies......Page 253
Getting More from the responseText Property......Page 255
Summary......Page 261
Introducing AHAH......Page 263
Creating a Small Library for AHAH......Page 264
Using myAHAHlib.js......Page 266
Summary......Page 271
Adding the “x” to Ajax......Page 273
The responseXML Property......Page 274
Project—An RSS Headline Reader......Page 278
Summary......Page 285
Introduction to Web Services......Page 287
REST—Representational State Transfer......Page 288
Using REST in Practice......Page 290
Web Services Using SOAP......Page 294
The SOAP Protocol......Page 295
Using Ajax and SOAP......Page 298
Reviewing SOAP and REST......Page 299
Summary......Page 300
An Ajax Library......Page 301
Reviewing myAHAHlib.js......Page 302
Implementing Our Library......Page 303
Using the Library......Page 306
Summary......Page 309
Common Ajax Errors......Page 311
The Back Button......Page 312
Making Ajax Degrade Elegantly......Page 313
Dealing with Search Engine Spiders......Page 314
Don’t Use Ajax Where It’s Inappropriate......Page 315
Test Code Across Multiple Platforms......Page 316
Some Programming Gotchas......Page 317
Summary......Page 318
Part VI: Ajax Tools and Resources......Page 319
Introducing prototype.js......Page 321
Wrapping XMLHTTPRequest—the Ajax Object......Page 324
Example Project—Stock Price Reader......Page 327
Summary......Page 329
Introducing Rico......Page 331
Rico’s Other Interface Tools......Page 336
Summary......Page 340
Downloading the Library......Page 341
Using Effects......Page 342
Building the Script......Page 343
Summary......Page 345
Introducing XOAD......Page 347
XOAD HTML......Page 350
Advanced Programming with XOAD......Page 353
Summary......Page 354
JavaScript Websites......Page 355
Web Development Sites......Page 356
Ajax Websites......Page 357
C......Page 359
E......Page 360
L......Page 361
S......Page 362
X......Page 363
Index......Page 365
A......Page 366
C......Page 367
D......Page 368
E......Page 369
F......Page 370
H......Page 371
I......Page 372
K - L......Page 373
M......Page 374
O......Page 375
P......Page 376
Q - R......Page 378
S......Page 379
V......Page 381
W......Page 382
Y - Z......Page 383