AJAX - The Complete Reference

(avery) #1

10


Web Services and Beyond


A


jax and related ideas are changing at a furious pace. In this chapter we present but a
brief overview of a few of the most important areas of change in the world of Ajax,
including the use of remote data and application in the form of Web Services, a
push-style communication pattern generally dubbed Comet, and the final missing piece so
that Web applications can compete with desktop apps: offline storage and operation. Given
the tremendous rate of innovation in each of these areas, our aim is to present an overview
of the idea, a discussion of some of the ramifications and concerns surrounding it, and a
representative example or two with a bit less emphasis on syntax specifics than general
approach. That’s not to say that we won’t provide working examples—there are plenty to
be found here—but compared to those presented in earlier chapters, these are more likely to
break as APIs outside of our control change. As such, we encourage readers to visit the book
support site for the latest info in case they encounter problems. So, with warning in hand,
let us begin our exploration of the bleeding edges of Ajax.

Ajax and Web Services


Ajax and Web Services are often mentioned in the same breath, which is quite interesting
considering that as of yet they really do not work well together. As we have seen throughout the
book, at this moment in time (late 2007), the same origin policy restricts cross-domain requests
that would be mandatory in order to use a Web Service directly from client-side JavaScript.
For example, if you desired to build a Web page and host it on your server (example.com) and
then call a Web Service on google.com, you could not do so directly using an XHR.

483


CHAPTER


http://www.ebooks.org.in

Free download pdf