Creating an Ajax Updater

In order to keep our Ajax object in the background and add a layer of abstraction to our engine, we will create an object called AjaxUpdater. This object is another that follows the Singleton pattern to keep it accessible from all scopes of the application for easy XHR management and control. The object is very simple and consists of only a few methods—one of which could be the only one that is ever used. The other is optional, or a backup for handling optional functionality. Let’s start by constructing the object.

Constructing the Object

We will construct this object as we did with the Ajax object. The difference with this object is that we will be initializing the property we used in the Ajax object that we briefly ...

Get Ajax for Web Application Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.