Bulletproof Ajax

Bulletproof Ajax

Jeremy Keith

Language: English

Pages: 216

ISBN: 0321472667

Format: PDF / Kindle (mobi) / ePub


Step-by-step guide reveals best practices for enhancing Web sites with Ajax

  • A step-by-step guide to enhancing Web sites with Ajax.
  • Uses progressive enhancement techniques to ensure graceful degradation (which makes sites usable in all browsers).
  • Shows readers how to write their own Ajax scripts instead of relying on third-party libraries.

Web site designers love the idea of Ajax--of creating Web pages in which information can be updated without refreshing the entire page. But for those who aren't hard-core programmers, enhancing pages using Ajax can be a challenge. Even more of a challenge is making sure those pages work for all users. In Bulletproof Ajax, author Jeremy Keith demonstrates how developers comfortable with CSS and (X)HTML can build Ajax functionality without frameworks, using the ideas of graceful degradation and progressive enhancement to ensure that the pages work for all users. Throughout this step-by-step guide, his emphasis is on best practices with an approach to building Ajax pages called Hijax, which improves flexibility and avoids worst-case scenarios.

Professional NoSQL (Wrox Programmer to Programmer)

HTML5 Pocket Reference (5th Edition)

A Concise Introduction To Software Engineering

Networking All-in-One Desk Reference For Dummies

 

 

 

 

 

 

 

 

 

 

 

 

Functions and variables. When functions and variables are bundled up in this way, they are called methods and properties. 32 Chapter 2 A method is a function that belongs to an object. A method can take arguments, just like a function. To execute a method, it must be preceded by the name of the object to which it belongs, and a dot: object.method(); A property is accessed using the same kind of dot notation: object.property; You’ve already seen this kind of notation in action. Every time you.

Other markup languages like SGML and HTML in that the vocabulary is not prescribed. Instead, the author of an XML document is free to use whatever terms make the most sense to her. It’s a kind of metalanguage. The structure of an XML document must follow certain rules, but the vocabulary used within that structure isn’t tied to any dictionary of terms. AN EXAMPLE OF XML Here is a simple XML document called jeremy.xml: Jeremy Keith.

Browser to carry out complex programming tasks that are integral to the application’s operation. I believe this is a mistake. Before Ajax, a Web site worked like a self-service restaurant. Every time you wanted some information, the browser had to fetch a new page. In a selfservice restaurant, whenever you want some food, you have to go up to the counter to order it. Adding Ajax to a Web site is like hiring a waiter for a restaurant. The customer no longer needs to go to the counter to order.

Into the page. This might be as simple as writing the text “Loading…” into an appropriate element. A more effective solution would be to use animation. Take a leaf out of the browser manufacturer’s book. Create an endlessly looping animated image and then display this image until the response is successfully received. Ajax Challenges 127 The simplest format for this kind of image is an animated GIF file. The exact image can be anything you like, as long as it features a smoothly looping.

.45 Origins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Create an Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Send a Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Receive a Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Download sample

Download