AJAX Books

Ballard, P. (2006) SAMS Teach Yourself Ajax in 10 Minutes, Sams Publishing

Download eBook CHM (RAR 2,490KB)

Download Source Code (ZIP 19KB)

Sams Teach Yourself Ajax in 10 Minutes is a concise introduction to the basics of building Ajax applications and the architecture and operation of these applications. You will learn the techniques employed in using Ajax, introducing Ajax and explaining how it may be used to solve realistic user interface problems. You will be able to immediately begin building web applications, and will have platform from which to explore more advanced aspects of Ajax.

Table of Contents

PART I    A Refresher on Web Technologies

1    Anatomy of a Website    5

2    Writing Web Pages in HTML    13

3    Sending Requests Using HTTP    27

4    Client-Side Coding Using JavaScript    36

5    Server-Side Programming in PHP    53

6    A Brief Introduction to XML    61

 

PART II    Introducing Ajax

7    Anatomy of an Ajax Application    70

8    The XMLHTTPRequest Object    80

9    Talking with the Server    91

10   Using the Returned Data    102

11   Our First Ajax Application    112

 

PART III    More Complex Ajax Technologies

12    Returning Data as Text    123

13    AHAH–Asynchronous HTML and HTTP    131

14    Returning Data as XML    142

15    Web Services and the REST Protocol    157

16    Web Services Using SOAP    166

17    A JavaScript Library for Ajax    173

18    Ajax “Gotchas”    184

 

PART IV    Commercial and Open Source Ajax Resources

19    The prototype.js Toolkit    193

20    Using Rico    203

21    Using ZOAD    215


0071494294Holzner, S. (2009) Ajax – A Beginner’s Guide, McGraw-Hill Education

Download eBook PDF (PDF 11,653KB)

Download Source Code  (ZIP 164KB)

Learn how to use Ajax (Asynchronous JavaScript and XML) to create Web applications that mirror the richness of desktop applications. Using easy-to-follow examples, Ajax: A Beginner’s Guide gets you started working with this cutting-edge collection of technologies in no time. Create XMLHttpRequest objects and use JavaScript, XML, DHTML, CSS, PHP, and more to build next-generation Web applications. You’ll also find out about a variety of free, pre-written Ajax frameworks you can use right away.

Designed for Easy Learning:

  • Key Skills & Concepts–Lists of specific skills covered in the chapter
  • Ask the Expert–Q&A sections filled with bonus information and helpful tips
  • Try This–Hands-on exercises that show how to apply your skills
  • Annotated Syntax–Example code with commentary that describes the programming techniques being illustrated

Table of Contents

Chapter 1. Essential Ajax
Chapter 2. Getting to Know JavaScript
Chapter 3. Creating Ajax Applications
Chapter 4. Full Throttle Ajax
Chapter 5. Using Ajax Frameworks
Chapter 6. Handling XML in Ajax
Chapter 7. Working with Cascading Style Sheets with Ajax
Chapter 8. Handling Dynamic HTML with Ajax
Chapter 9. Introducing PHP with Ajax
Chapter 10. PHP in Depth
Chapter 11. Validating User Input with Ajax and PHP
Chapter 12. Using the HTML DOM and Ajax


imagesCADK4Q5NEernisse, M. (2006) Build Your Own AJAX Web Applications, SitePoint Pty. Ltd

Download eBook PDF (PDF 3,050KB)

Download Source Code (ZIP 66KB)

Now you can join the likes of Google Maps, Google Suggest, Backpack, and Flickr by taking advantage of the usability, interactivity and responsiveness benefits of AJAX!

Build Your Own AJAX Web Applications is a practical, step-by-step guide to bringing next-generation interactivity to your web sites today. This book will help you build responsive, professional, robust AJAX applications that adhere to best practices and enhance the user experience while maintaining your application’s accessibility.

What Is AJAX?

AJAX is the technique of making web pages more interactive by using JavaScript to pull updated information from the server and modify the page displayed in the browser on the fly.

The added interactivity and responsiveness can boost your application’s usability, making it:

  • easier to use
  • more fun to use
  • more intuitive

What Will I Learn?

Build Your Own AJAX Web Applications uses a step-by-step tutorial format that’s so easy to follow, you’ll be able to build sophisticated and intuitive AJAX web interfaces in no time!

Read this book, and you’ll:

  • Get an overview of the basic technologies you’ll need to use to build AJAX applications.
  • Understand the XMLHttpRequest object, the core of AJAX applications.
  • Build a cross-browser XMLHttpRequest wrapper that you can use in all of your AJAX projects.
  • Build an AJAX application monitor that works in real time.
  • Learn how to use AJAX without breaking older browsers or causing accessibility issues.
  • Get your AJAX application working with screen readers.
  • Use dynamic animations to improve usability.
  • Build edit-in-place functionality.
  • Create an AJAX search application that pulls data from Amazon, del.icio.us, and Google.
  • Fix the Back button problem.
  • Use JSON, YAML, and XML to communicate with the server..
  • Build an AJAX drag ‘n’ drop chess game.

…And a whole lot more!

AJAX (Asynchronous JavaScript and XML) is a new approach for developing web applications. It essentially permits users to interact with a Webpage without forcing a slow & tedious reload of the entire page after every action. This means web applications become more responsive, easier to use, and more intuitive.Build Your Own Ajax Web Applications uses a step-by-step tutorial format that’s so easy to follow, you’ll be able to build sophisticated and intuitive Ajax web interfaces in no time!

Read this book, and you’ll:

  • Get an overview of the basic technologies you’ll need to use to build Ajax applications.
  • Understand the XMLHttpRequest object, the core of Ajax applications.
  • Build a cross-browser XMLHttpRequest wrapper that you can use in all of your Ajax projects.
  • Build an Ajax application monitor that works in real time.
  • Learn how to use Ajax without breaking older browsers or causing accessibility issues.
  • Get your Ajax application working with screen readers.
  • Use dynamic animations to improve usability.
  • Build edit-in-place functionality.
  • Create an Ajax search application that pulls data from Amazon, del.icio.us, and Google.
  • Fix the “Back button” problem.
  • Use JSON, YAML, and XML to communicate with the server.
  • Build an Ajax drag ‘n’ drop chess game.
  • And a whole lot more!Throughout the text, the author stresses usability, accessibility, and graceful degradation for older, less-capable web browsers.

Table of Contents

Ajax: The Overview Basic XMLHttpRequest The “A” in Ajax Ajax & Post requests Broader Ajax with Edit-in-place Web servers & slide & hide More web services & a back button Drag & drop with Ajax chess


0672329654Ballard, P. and Moncur, M. (2009) Sams Teach Yourself Ajax, JavaScript and PHP All in One, Sams Publishing

 

 

 

 


detailSams Teach Yourself JavaScript and Ajax: Video Learning Starter Kit –  Quick Start Guide (2009) Sams Publishing

Part I: Web Basics Refresher
The lessons in Part I provide a refresher on the fundamental building blocks of Web development:

Lesson 1: Workings of the Web. Introduces you to what the World Wide Web is and its key HTTP protocol. (SWF 5,134KB)

Lesson 1 – Lab (SWF 59KB)

Lesson 1 – Quiz (SWF 61KB)
Lesson 2: Writing Pages in HTML and CSS. Provides you with a sound foundation in HTML and CSS for the Ajax applications in later lessons.

Part 1 (SWF 3,432KB)

Part 2 (SWF 3,364KB)

Lesson 2 – Lab (SWF 66KB)

Lesson 2 – Quiz (SWF 61KB)

Lesson 3: Anatomy of an Ajax Application. Examines the individual building blocks of Ajax and how they fit together. (SWF 3,293KB)

Lesson 3 – Quiz (SWF 61KB)


Part II: Web Scripting with JavaScript
The lessons in Part II covers the basics of adding scripting to web pages using JavaScript:

Lesson 4: Creating Simple Scripts in JavaScript. Shows you how to create a simple script, edit it, and test it using a web browser.

Part 1 (SWF 2,834KB)

Part 2 (SWF 2,704KB)

Part 3 (SWF 1,923KB)

Lesson 4 – Lab (SWF 65KB)

Lesson 4 – Quiz (SWF 61KB)

Lesson 5: Working with the DOM. Introduces one of the most important tools you’ll use with JavaScript: the Document Object Model (DOM). (SWF 4,029KB)_

Lesson 5 – Lab (SWF 60KB)

Lesson 5 – Quiz (SWF 61KB)

Lesson 6: Variables, Strings, and Arrays. Explains three tools for storing data in JavaScript: variables, which store numbers or text; strings, which are special variables for working with text; and arrays, which are multiple variables you can refer to by number.

Part 1 (SWF 5,099KB)

Part 2 (SWF 2,003KB)

Lesson 6 – Lab (SWF 66KB)

Lesson 6 – Quiz (SWF 802KB)

Lesson 7: Using Functions and Objects. Covers two more key JavaScript concepts you’ll use later on with Ajax: functions, which enable you to group any number of statements into a block, and objects, which enable you to group data. (SWF 14,108KB)

Lesson 7 – Lab (SWF 61KB)

Lesson 7 – Quiz (SWF 60KB)

Lesson 8: Conditions and Loops – Controlling Flow. Examines two ways to control program flow in JavaScript: conditions, which allow a choice of difference options depending on a value, and loops, which allow repetitive statements. (SWF 5,436KB)

Lesson 8 – Lab (SWF 65KB)

Lesson 8 – Quiz (SWF 61KB)

Lesson 9: Using Built-In Functions and Third-Party Libraries. Covers the use of some key objects in JavaScript, including Math and Date, as well as third-party libraries. (SWF 3,326KB)

Lesson 9 – Lab (SWF 90KB)

Lesson 9 – Quiz (SWF 61KB)


Part III: Introducing Ajax
The lessons in Part III introduce Ajax technologies for extending JavaScript’s capabilities:

Lesson 10: The XMLHTTPRequest Object. Examines the object at the heart of every Ajax application – the XMLHTTPRequest object. (SWF 2,239KB)

Lesson 10 – Lab (SWF 61KB)

Lesson 10 – Quiz (SWF 792KB)

Lesson 11: Talking with the Server. Shows how to send requests to, and receive data from, the server. (SWF 2,917KB)

Lesson 11 – Lab (SWF 65KB)

Lesson 11 – Quiz (SWF 61KB)

Lesson 12: Using the Returned Data. Examines how to process information returned from the server in response to an Ajax request. (SWF 6,382KB)

Lesson 12 – Lab (SWF 65KB)

Lesson 12 – Quiz (SWF 62KB)

Lesson 13: Our First Ajax Application. Shows how to construct a complete and working Ajax application. (SWF 5,546KB)

Lesson 13 – Lab (SWF 65KB)

Lesson 13 – Quiz (SWF 60KB)


Part IV: Server-Side Scripting with PHP
The lessons in Part IV deal with using PHP to communicate with a web server and extend Ajax applications:

Lesson 14: Getting to Know PHP. Tells you what PHP is all about and what it’s able to do. (SWF 2,397KB)

Lesson 14 – Lab (SWF 63KB)

Lesson 14 – Quiz (SWF 61KB)

Lesson 15: Variables. Examines how to assign values to variables in PHP and how to use them in some simple expressions.

Part 1 (SWF 4,133KB)

Part 2 (SWF 3,141KB)

Lesson 15 – Lab (SWF 69KB)

Lesson 15 – Quiz (SWF 61KB)

Lesson 16: Flow Control. Looks at how to control the flow of a PHP script using conditional statements and loops. (SWF 2,747KB)

Lesson 16 – Lab (SWF 65KB)

Lesson 16 – Quiz (SWF 61KB)

Lesson 17: Functions. Explains how frequently used sections of code can be turned into reusable functions. (SWF 2,882KB)

Lesson 17 – Lab (SWF 62KB)

Lesson 17 – Quiz (SWF 61KB)

Lesson 18: Using Classes. Covers the basics of object-oriented PHP. (SWF 2,606KB)

lesson18Lesson 18 – Lab (SWF 63KB)

Lesson 18 – Quiz (SWF 61KB)


Part V: Advanced Ajax Programming
Part IV looks at some advanced Ajax techniques for handling data and at building a library of Ajax scripts

Lesson 19: Returning Data as Text. Shows how to use the responseText property to add functionality to Ajax applications. (SWF 1,883KB)

Lesson 19 – Lab (SWF 60KB)

Lesson 20: Asynchronous HTML and HTTP (AHAH). Explains how to build Ajax-style applications without using XML. (SWF 7,487KB)

Lesson 20 – Lab (SWF 61KB)

Lesson 20 – Quiz (SWF 60KB)

Lesson 21: Returning Data as XML. Shows how to use XML data returned from the server via the responseXML property of the XMLHTTPRequest object. (SWF 3,020KB)

Lesson 21 – Lab (SWF 62KB)

Lesson 21 – Quiz (SWF 61KB)

Lesson 22: Implementing Web Services with REST and SOAP. Discusses the basics of web services and how to implement them using the REST and SOAP protocols. (SWF 4,805KB)

Lesson 22 – Lab (SWF 59KB)

Lesson 22 – Quiz (SWF 61KB)

Lesson 23: Building an Ajax Library. Explains how to build a small library of scripts that you can call from your applications. (SWF 2,504KB)

Lesson 23 – Lab (SWF 64KB)

Lesson 23 – Quiz (SWF 60KB)

Lesson 24: Avoiding Ajax Gotchas. Discusses some of the common Ajax mistakes and how to avoid them. (SWF 10,821KB)

Lesson 24 – Quiz (SWF 61KB)


Riordan, R. M. (2008) Head First AJAX, O’Reilly Media, Inc

Ajax is no longer an experimental approach to website development, but the key to building browser-based applications that form the cornerstone of Web 2.0. Head First Ajax gives you an up-to-date perspective that lets you see exactly what you can do—and has been done—with Ajax. With it, you get a highly practical, in-depth, and mature view of what is now a mature development approach.

Using the unique and highly effective visual format that has turned Head First titles into runaway bestsellers, this book offers a big picture overview to introduce Ajax, and then explores the use of individual Ajax components—including the JavaScript event model, DOM, XML, JSON, and more—as it progresses. You’ll find plenty of sample applications that illustrate the concepts, along with exercises, quizzes, and other interactive features to help you retain what you’ve learned.

Head First Ajax covers:

  • The JavaScript event model
  • Making Ajax requests with XMLHTTPREQUEST objects
  • The asynchronous application model
  • The Document Object Model (DOM)
  • Manipulating the DOM in JavaScript
  • Controlling the browser with the Browser Object Model
  • XHTML Forms
  • POST Requests
  • XML Syntax and the XML DOM tree
  • XML Requests & Responses
  • JSON — an alternative to XML
  • Ajax architecture & patterns
  • The Prototype Library

The book also discusses the server-side implications of building Ajax applications, and uses a “black box” approach to server-side components.

Head First Ajax is the ideal guide for experienced web developers comfortable with scripting—particularly those who have completed the exercises in Head First JavaScript—and for experienced programmers in Java, PHP, and C# who want to learn client-side programming.

Table of Contents

Advance Praise for Head First Ajax; Author of Head First Ajax; How to Use this Book: Intro; Who is this book for?; We know what you’re thinking; We know what your brain is thinking; Metacognition: thinking about thinking; Here’s what WE did; Here’s what YOU can do to bend your brain into submission; Read Me; The technical review team; Acknowledgments; Safari® Books Online; Chapter 1: Using Ajax: Web Apps for a New Generation; 1.1 Web pages: the old-fashioned approach; 1.2 Web pages reinvented; 1.3 So what makes a page “Ajax”?; 1.4 Rob’s Rock ‘n’ Roll Memorabilia; 1.5 Ajax and rock ‘n’ roll in 5 steps; 1.6 Step 1: Modify the XHTML; 1.7 Step 2: Initialize the JavaScript; 1.8 Step 3: Create a request object; 1.9 Step 4: Get the item’s details; 1.10 Let’s write the code for requesting an item’s details; 1.11 Always make sure you have a request object before working with it; 1.12 The request object is just an object; 1.13 Hey, server… will you call me back at displayDetails(), please?; 1.14 Use send() to send your request; 1.15 The server usually returns data to Ajax requests; 1.16 Ajax is server-agnostic; 1.17 Use a callback function to work with data the server returns; 1.18 Get the server’s response from the request object’s responseText property; 1.19 Goodbye traditional web apps…; Chapter 2: Designing Ajax Applications: Thinking Ajaxian; 2.1 Mike’s traditional web site; 2.2 Let’s use Ajax to send registration requests ASYNCHRONOUSLY; 2.3 Update the registration page; 2.4 Set the window.onload event handler… PROGRAMMATICALLY; 2.5 Code in your JavaScript outside of functions runs when the script is read; 2.6 What happens when…; 2.7 And on the server…; 2.8 Some parts of your Ajax designs will be the same… every time; 2.9 createRequest() is always the same; 2.10 Create a request object… on multiple browsers; 2.11 Ajax app design involves both the web page AND the server-side program; 2.12 What we’ve done so far…; 2.13 What we still need to do…; 2.14 The request object connects your code to the web browser; 2.15 You talk to the browser, not the server; 2.16 The browser calls back your function with the server’s response; 2.17 Show the Ajax registration page to Mike…; 2.18 The web form has TWO ways to send requests to the server now; 2.19 Let’s create CSS classes for each state of the processing…; 2.20 … and change the CSS class with our JavaScript; 2.21 Changes? We don’t need no stinkin’ changes!; 2.22 Only allow registration when it’s appropriate; Chapter 3: Javascript Events: Reacting to your users; 3.1 It all started with a downward-facing dog…; 3.2 Ajax apps are more than the sum of their parts; 3.3 Here’s Marcy’s XHTML…; 3.4 Events are the key to interactivity; 3.5 Connect events on your web page to event handlers in your JavaScript; 3.6 Use the window.onload event to initialize the rest of the interactivity on a web page; 3.7 Change those left-side images to be clickable; 3.8 Use your XHTML’s content and structure; 3.9 Add the code for hideHint(), too; 3.10 Tabs: an optical (and graphical) illusion; 3.11 Use a for… loop to cycle through the images; 3.12 CSS classes are the key (again); 3.13 Ummm… but the tabs aren’t < a >’s !; 3.14 This broke our JavaScript, too, didn’t it?; 3.15 Use a request object to fetch the class details from the server; 3.16 Be careful when you have two functions changing the same part of a web page; 3.17 When you need to change images in your script, think “change CSS classes” instead; 3.18 Links in XHTML are represented by elements; 3.19 We need a function to show an active button and hide a button, too; Chapter 4: Multiple Event Handlers: Two’s company; 4.1 An event can have only one event handler attached to it (or so it seems); 4.2 Event handlers are just properties; 4.3 A property can have only ONE value; 4.4 Assign multiple event handlers with addEventListener(); 4.5 Your objects can have multiple event handlers assigned to a single event in DOM Level 2; 4.6 What’s going on with Internet Explorer?; 4.7 Internet Explorer uses a totally different event model; 4.8 attachEvent() and addEventListener() are functionally equivalent; 4.9 addEventHandler() works for ALL apps, not just Marcy’s yoga page; 4.10 Let’s update initPage() to use our new utility function; 4.11 Use an alert() to troubleshoot; 4.12 So what else could be going wrong?; 4.13 Event handlers in IE are owned by IE’s event framework, NOT the active page object; 4.14 attachEvent() and addEventListener() supply another argument to our handlers; 4.15 We need to name the Event argument, so our handlers can work with it; 4.16 You say target tomato, I say srcElement tomato…; 4.17 So how do we actually GET the object that triggered the event?; Chapter 5: Asynchronous Applications: It’s like renewing your driver’s license; 5.1 What does asynchronous really mean?; 5.2 You’ve been building asynchronous apps all along; 5.3 But sometimes you barely even notice…; 5.4 Speaking of more server-side processing…; 5.5 (More) Asynchrony in 3 easy steps; 5.6 We need two password fields and a

for the cover images; 5.7 If you need new behavior, you probably need a new event handler function; 5.8 With ONE request object, you can safely send and receive ONE asynchronous request; 5.9 Asynchronous requests don’t wait on anything… including themselves!; 5.10 If you’re making TWO separate requests, use TWO separate request objects; 5.11 Asynchrony means you can’t count on the ORDERING of your requests and responses; 5.12 A monitor function MONITORS your application… from OUTSIDE the action; 5.13 You call a monitor function when action MIGHT need to be taken; 5.14 Status variables let monitors know what’s going on; 5.15 And now for our last trick…; 5.16 Synchronous requests block ALL YOUR CODE from doing anything; 5.17 Use setInterval() to let JavaScript run your process, instead of your own code; Chapter 6: The Document Object Model: Web Page Forestry; 6.1 You can change the CONTENT of a page…; 6.2 … or you can change the STRUCTURE of a page; 6.3 Browsers use the Document Object Model to represent your page; 6.4 Here’s the XHTML that you write…; 6.5 … and here’s what your browser sees; 6.6 Your page is a set of related objects; 6.7 Let’s use the DOM to build a dynamic app; 6.8 You start with XHTML…; 6.9 appendChild() adds a new child to a node; 6.10 You can locate elements by name or by id; 6.11 Can I move the clicked tile?; 6.12 You can move around a DOM tree using FAMILY relationships; 6.13 A DOM tree has nodes for EVERYTHING in your web page; 6.14 The nodeName of a text node is “#text”; 6.15 Did I win? Did I win?; 6.16 But seriously… did I win?; Chapter 7: Manipulating the DOM: My wish is your command; 7.1 Webville Puzzles… the franchise; 7.2 Woggle doesn’t use table cells for the tiles; 7.3 The tiles in the XHTML are CSS-positioned; 7.4 “We don’t want TOTALLY random letters…”; 7.5 Our presentation is ALL in our CSS; 7.6 We need a new event handler for handling tile clicks; 7.7 Start building the event handler for each tile click; 7.8 We can assign an event handler in our randomizeTiles() function; 7.9 Property values are just strings in JavaScript; 7.10 We need to add content AND structure to the “currentWord”

; 7.11 Use the DOM to change a page’s structure; 7.12 Use createElement() to create a DOM element; 7.13 You have to TELL the browser where to put any new DOM nodes you create; 7.14 We need to disable each tile. That means changing the tile’s CSS class…; 7.15 … AND turning OFF the addLetter() event handler; 7.16 Submitting a word is just (another) request; 7.17 Our JavaScript doesn’t care how the server figures out its response to our request; 7.18 Usability check: WHEN can submitWord() get called?; Chapter 8: Frameworks and Toolkits: Trust No One; 8.1 So what frameworks ARE there?; 8.2 Every framework uses a different syntax to do things; 8.3 The syntax may change… but the JavaScript is still the same; 8.4 To framework or not to framework?; 8.5 The choice is up to you…; Chapter 9: XML Requests and Responses: More Than Words Can Say; 9.1 Classic rock gets a 21st century makeover; 9.2 How should a server send a MULTI-valued response?; 9.3 InnerHTML is only simple for the CLIENT side of a web app; 9.4 You use the DOM to work with XML, just like you did with XHTML; 9.5 XML is self-describing; Chapter 10: JSON: SON of JavaScript; 10.1 JSON can be text AND an object; 10.2 JSON data can be treated as a JavaScript object; 10.3 So how do we get JSON data from the server’s response?; 10.4 JavaScript can evaluate textual data; 10.5 Use eval() to manually evaluate text; 10.6 Evaluating JSON data returns an object representation of that data; 10.7 JavaScript objects are ALREADY dynamic… because they’re not COMPILED objects; 10.8 You can access an object’s members… and then get an object’s values with those members; 10.9 You need to PARSE the server’s response, not just EVALUATE it; 10.10 So which is the better data format?; Chapter 11: Forms and Validation: Say what you meant to say; 11.1 Marcy’s Yoga for Programmers… a booming new enterprise; 11.2 Validation should work from the web page BACK to the server; 11.3 You can validate the FORMAT of data, and you can validate the CONTENT of data; 11.4 We need to validate the FORMAT of the data from Marcy’s enrollment page; 11.5 Don’t Repeat Yourself: DRY; 11.6 Let’s build some more event handlers; 11.7 RETURN of SON of JavaScript; 11.8 The value of a property can be another JavaScript object; 11.9 Let’s warn Marcy’s customers when there’s a problem with their entry; 11.10 If you don’t warn(), you have to unwarn(); 11.11 IF there’s a warning, get rid of it; 11.12 Duplicate data is a SERVER problem; 11.13 So we’re done now, right?; Chapter 12: Post Requests: Paranoia: It’s your friend; 12.1 There’s a villain in the movies; 12.2 GET requests send request parameters across the network as clear text; 12.3 POST requests DON’T send clear text; 12.4 The data in a POST request is ENCODED until it reaches the server; 12.5 send() your request data in a POST request; 12.6 Always check to make sure your request data was RECEIVED.; 12.7 Why didn’t the POST request work?; 12.8 The server unencodes POST data; 12.9 We need to TELL the server what we’re sending; 12.10 Set a request header using setRequestHeader() on your request object; Leftovers: The Top Five Topics (we didn’t cover); #1 Inspecting the DOM; Inspecting the DOM in Internet Explorer; Inspecting the DOM in Safari; #2 Graceful degradation; #3 script.aculo.us and the Yahoo UI libraries; #4 Using JSON libraries in your PHP code; Using JSON in PHP 5.1 and earlier; #5 Ajax and ASP.NET; You don’t NEED ASP.NET Ajax to build Internet Explorer-compatible web apps; Utility Functions: Just Gimme the Code; utils.js: a work in progress;

|

  • Advance Praise for Head First Ajax
  • Author of Head First Ajax
  • How to Use this Book: Intro
  • Chapter 1: Using Ajax: Web Apps for a New Generation
  • Chapter 2: Designing Ajax Applications: Thinking Ajaxian
  • Chapter 3: Javascript Events: Reacting to your users
  • Chapter 4: Multiple Event Handlers: Two’s company
  • Chapter 5: Asynchronous Applications: It’s like renewing your driver’s license
  • Chapter 6: The Document Object Model: Web Page Forestry
  • Chapter 7: Manipulating the DOM: My wish is your command
  • Chapter 8: Frameworks and Toolkits: Trust No One
  • Chapter 9: XML Requests and Responses: More Than Words Can Say
  • Chapter 10: JSON: SON of JavaScript
  • Chapter 11: Forms and Validation: Say what you meant to say
  • Chapter 12: Post Requests: Paranoia: It’s your friend
  • Leftovers: The Top Five Topics (we didn’t cover)
  • Utility Functions: Just Gimme the Code

Code Downloads and Example Web Sites

Check out these pages for downloadable packages of the final versions of the sites in the book, as well as links to view them in your browser.

1. Using Ajax: Web Apps for a New Generation
2. Designing Ajax Applications: Thinking Ajaxian
3. JavaScript Events: Reacting to Your Users
4. Multiple Event Handlers: Two’s Company
5. Asynchronous Applications: It’s like Renewing Your Driver’s License
6. The Document Object Model: Web Page Forestry
7. Manipulating the DOM: Your Wish is My Command
8. Frameworks and Toolkits: Trust No One
9. XML Requests and Responses: More Than Words Can Say
10. JSON: SON of JavaScript
11. Forms and Validation: Say What You Meant to Say
12. Post Requests: Paranoia: It’s Your Friend


Holzner, S. (2006) Ajax: Your Visual Blueprint for Creating Rich Internet Applications, Wiley Publishing, Inc.

 Download Source Code (ZIP 146KB)

Welcome to the only guidebook series that takes a visual approach to professional–level computer topics. Open the book and you′ll discover step–by–step screen shots that demonstrate over 150 key Ajax techniques, including:
∗ Downloading data from behind the scenes
∗ Enabling real–time live searches
∗ Playing games that use Ajax
∗ Populating pop–up menus
∗ Accessing Web pages from JavaScript
∗ Handling menus, colors, and backgrounds
∗ Creating interactive mouseovers
∗ Updating shopping carts
∗ Installing Ajax frameworks
∗ Validating XML from the server
∗ Enabling auto–completion of typed terms
∗ Downloading images behind the scenes

“I just purchased my third Visual book (my first two are dog–eared now!) and, once again, your product has surpassed my expectations. Keep up the wonderful work!”
–Tracey Moore (Memphis, TN)
∗ High–resolution screen shots demonstrate each task
∗ Succinct explanations walk you through step by step
∗ Two–page lessons break big topics into bite–sized modules
∗ “Apply It” and “Extra” sidebars highlight useful tips

 

Table of Contents

HOW TO USE THIS BOOK.

1 GETTING INTO AJAX.

Get into Ajax.

Using an Ajax–Based Application.

Run a Live Search.

Autocomplete What You Type.

Modify Web Pages without Page Refreshes.

Drag and Drop with Ajax.

Get Instant Login Feedback.

Create Rich Displays with Ajax.

Create Games with Ajax.

Chat Online Using Ajax.

Download Images with Ajax.

2 CREATING AJAX USING JAVASCRIPT.

Create a Script.

View JavaScript Errors.

Handle Browser Events.

Create JavaScript Functions.

Display Results Where You Choose in a Page.

Connect HTML Buttons to JavaScript.

Display Text in Text Fields.

Pass Arguments to Functions.

Return Data from Functions.

Store Data in Variables.

Work with Operators.

Use JavaScript Operators.

Create Local Variables.

Make Choices with the if Statement.

Using Comparison Operators.

Determine Browser Type and Version.

Repeat Code Execution with the for Loop.

Handle Multiple Data Items at Once Using Arrays.

Using the while Loop.

3 WRITING AJAX CODE.

Write Ajax.

Create an XMLHttpRequest Object Using JavaScript.

Open the XMLHttpRequest Object.

Get Ready to Download.

Download Data with the XMLHttpRequest Object.

Select Relative or Absolute URLs.

Create Newer XMLHttpRequest Objects in Internet Explorer.

Start Using Server–Side Scripts.

Create XML Documents for Download.

Download XML from the Server.

Create a Function That Adds Numbers.

Extract Data from XML Elements.

Read Data Sent to the Server.

Pass Data to the Server with GET.

Pass Data to the Server with POST.

4 GETTING MORE AJAX POWER.

Create Server–Side Mouseovers.

Download JavaScript Using Ajax.

Create a Live Search Using Google Suggest.

Connect to Google Suggest.

Display the Google Suggest Results.

Read Input and Send It to the Server for Validation.

Return Validation from the Server.

Get Header Information.

Extract Specific Header Data.

Check If a Document Exists.

Use Two XMLHttpRequest Objects at the Same Time.

Create an Array of XMLHttpRequest Objects.

Handle Multiple XMLHttpRequest Requests at the Same Time.

Call a Different Domain Safely.

Debug Ajax Code.

5 CREATING AJAX APPLICATIONS.

Convert Mouse Events into a Standard Format.

Handle Mouse Down and Mouse Up Events.

Handle Mouse Move Events.

Handle Mouse Click and Double–Click Events.

Handle Mouse Enter and Leave Events.

Create a Shopping Cart Application.

Drag an HTML Element in a Shopping Cart Application.

Drop an HTML Element in a Shopping Cart Application.

Update a Shopping Cart on the Server.

Download Image Names Using Ajax.

Display Images Using Ajax and Dynamic HTML.

Create an Ajax–Driven Menu System.

Display a Menu Using Cascading Styles.

Hide a Menu Using CSS.

Read Ajax–Driven Menu Selections.

6 EXPLORING THE BASIC AJAX FRAMEWORKS.

Using Ajax Frameworks.

Create the readTextWithGet Function.

Get Text with the readTextWithGet Function.

Create the readXmlWithGet Function.

Get XML with the readXmlWithGet Function.

Create the readTextWithPost Function.

Get Text with the readTextWithPost Function.

Create the readXmlWithPost Function.

Get XML with the readXmlWithPost Function.

Install AJAXLib.

Access the Server With AJAXLib.

Download Data With AJAXLib.

Install libXmlRequest.

Access the Server with libXmlRequest.

Download Data with libXmlRequest.

7 USING MORE POWERFUL AJAX FRAMEWORKS.

Install XHConn.

Access the Server with XHConn.

Download Data with XHConn.

Install SACK.

Access the Server with SACK.

Download Data with SACK.

Install Sarissa.

Access the Server with Sarissa.

Download Data with Sarissa.

Install Interactive Website Framework.

Connecting to the Server with the Interactive Website Framework.

Download Data with the Interactive Website Framework.

Install RICO.

Access the Server with RICO.

Download Data with RICO.

8 HANDLING SERVER–SIDE AJAX FRAMEWORKS.

Install SAJAX.

Write Server–Side Code with SAJAX.

Write Browser–Side Code with SAJAX.

Install Xajax.

Write Server–Side Code with Xajax.

Write Browser–Side Code with Xajax.

Install LibAjax.

Write Server–Side Code with LibAjax.

Write Browser–Side Code with LibAjax.

Chat with Direct Web Remoting.

Edit an Interactive Table with DWR.

Handling E–Mail with Echo2.

Support Auto–complete with the Ajax Tag Library.

Update HTML Elements with Ajax Tag Library.

9 HANDLING XML WITH AJAX.

Create an XML Document.

Write Well–Formed XML.

Handle XML in JavaScript.

Get the XML Document Element from Downloaded XML.

Navigate XML Using firstChild and lastChild.

Navigate XML Using nextSibling and previousSibling.

Extract Text Data From an XML Element.

Handle White Space in Mozilla and Firefox.

Create the removeWhitespace Function in Mozilla and Firefox.

Use the removeWhitespace Function in Mozilla and Firefox.

Find XML Elements by Name.

Extract XML Attributes.

Create a Valid XML Document.

Validate an XML Document.

Report XML Validation Errors.

10 USING CSS WITH AJAX.

Set Up CSS Styles.

Set Font Family and Size.

Underline or Italicize Text.

Make Text Bold.

Align Text.

Set Foreground Colors.

Make New Text More Noticeable.

Set Background Colors.

Set Background Images.

Position Elements Using Absolute Positioning.

Position Elements Using Relative Positioning.

Set HTML Element Visibility.

Create Web Page Pop–Ups.

Move Elements in a Web Page.

Overlap HTML Elements.

11 SUPPORTING AJAX ON THE SERVER WITH PHP.

Create a PHP Page.

Create HTML to Send to the Browser.

Work with Variables.

Create Arrays.

Use PHP Operators.

Handle Text String Data.

Make Choices with the if Statement.

Read Data from Text Fields.

Read Data from Check Boxes.

Read Data from Radio Buttons.

Send XML to the Browser.

Work with the for Loop.

Work with the while Loop.

Work with the foreach Loop.

Read Files on the Server.


php my sqlNixon, R. (2009) Learning PHP, MySQL and JavaScript – A Step-by-Step Guide to Creating Dynamic Websites – O’Reilly Media, Inc