Using AJAX in your Web Application Sitepoint (Îáó÷àþùåå Âèäåî, English)

Using AJAX in your Web Application Sitepoint (Îáó÷àþùåå Âèäåî, English)
Îïèñàíèå:
Îôèöèàëüíàÿ ñòðàíèöà:
Продолжительность: 1 ÷àñ
Ðàçðåøåíèå: 640 õ 480
Âèäåî Êîäåê: QuickTime
Àóäèî Êîäåê: MP3
4 Âèäåî ôàéëà. Ïåðâûé — Äåìîíñòðàöèÿ âîçìîæíîñòåé òåõíîëîãèè AJAX
Video 1:XMLHttpRequest (20:51 mins)In Part 1, Kevin gives a brief tour of his prototype for a personal finance web application, and stops to point out a usability issue for which AJAX is the ideal cure. Watch as he writes the JavaScript code necessary to enhance the simple form submit buttons so that they send requests to the server in the background, instead of making the user wait for the page to reload every time.
Key techniques discussed and demonstrated in this video include unobtrusive scripting, JavaScript event handlers, using regular expressions to match CSS class names, and using the XMLHttpRequest object to issue AJAX requests in the background. Although some of the server-side code presented in this video is written in PHP, the underlying principles are discussed in terms that apply to all server-side platforms.
What you’ll learn:
Use AJAX to improve the usability of existing applications.
Ensure graceful fallback when JavaScript is disabled with unobtrusive scripting.
Issue AJAX requests silently in the background using XMLHttpRequest.
Video 2: Generating XML Responses (20:36 mins)
In Part 2, Kevin walks you through the server side code of his personal finance application, and considers some of the development approaches that can reduce the amount of code you need to write on the server side to add AJAX functionality your applications. Kevin then makes the necessary modifications to process the AJAX requests that were generated in Part 1, and send back a response in XML format that will enable the browser to update the page that the user’s viewing on-the-fly.
Key topics covered in this video include the Model View Controller (MVC) architecture, the use of form buttons (not hyperlinks) for requests that make changes to server-side data, techniques for handling AJAX requests in your server-side code, and generating responses to those requests in XML format.
Much of the code presented in this video is written in PHP, but the principles and development techniques are discussed in terms that apply to all server-side platforms.
What you’ll learn:
Use MVC architecture to eliminate duplicate code.
Understand the differences between hyperlinks and form buttons and when to use each.
Reduce bandwidth bills by generating XML responses.
Video 3: Updating the UI (20:14 mins)
In Part 3, Kevin returns to the client side code of his personal finance application to write the code that will handle the XML responses that were generated by the server in Part 2. This code will be responsible not only for updating the user interface with fresh data once an AJAX response has been received, but also for providing “instant feedback” to notify the user when a request is in progress, and when a request has failed.
Key techniques discussed and demonstrated in this video include the judicious use of innerHTML for quick and easy changes to page content, assigning CSS classes to HTML elements to alter their appearance on-the-fly, processing XML data received from the server, and generating structured HTML content using the Document Object Model (DOM).
The JavaScript code required to perform the on-the-fly page updates required by all AJAX applications is among the most complex that a web developer will be asked to write. But it is also some of the most rewarding, because the quality of this code has a direct impact on the quality of the user experience you will produce.
What you’ll learn:
Provide instant feedback to prevent confusion.
Choose between innerHTML and DOM techniques for updating page content.
Process XML data received from the server in JavaScript.

Читайте также: