October 2006
Intermediate to advanced
288 pages
5h 55m
English
The Ajax wrapper that we will be creating is simply called Ajax, and is an object that follows the Singleton pattern, which we will cover in detail in Chapter 14, “Singleton Pattern.” This object will handle all requests to the server through the XHR as a single object that will always be reliable and never change states—hence the Singleton pattern. This way, any object that needs to make a request will do so through the same object, keeping the requests structured and organized. In order to create this object, we first need to simply construct it as in Listing 6.1.
Ajax = {};
|
After the object is constructed, we can create all the methods we will need to call ...
Read now
Unlock full access