Reviewing myAHAHlib.js
Listing 17.1 shows the code of myAHAHlib.js, reproduced from Lesson 13.
Listing 17.1. myAHAHlib.js
function callAHAH(url, pageElement, callMessage) { |
Let's consider how we may extend the capabilities of this library:
There is currently support only for HTTP GET requests. It would be useful to be able to support at least the HTTP POST request too, especially if you intend to build applications using the REST protocol (as described in Lesson 15, "Web Services and the REST Protocol").
The library currently only deals with text information returned via responseText and has no means to deal with responseXML.