0.5 beta 2 Release Notes






0.5 beta 2 Release Notes

[edit] Added callback feature (replaces loading/unloadingFunction)

New callback feature extends and improves on previous methods of handling request events on browser / javascript side. In xajax 0.2.4, you could assign functions to a loading and unloading callback function, to show and hide a message. In xajax 0.5 beta 1 this functionality remained, but was extracted to a separate module called 'hooks' in SVN (unreleased versions). Prior to the xajax 0.5 beta 2 release, the hooks component was then improved and renamed to 'callbacks'.

Callback events (aka callbacks) can now be assigned on a global bases through the global callback object:

xajax.callback.global

and individual callback objects can be created on an as needed basis like so:

var myCallback = xajax.callback.create(x, y);  // x=response delay timeout, y=expiration delay timeout

You can then write functions that are called when xajax reaches various points in the request / response process. The events available are:

onRequest: called when the request is initiated
onResponseDelay: called x milliseconds after the request has been sent to the server, but no response has been received
onExpiration: called y milliseconds after the request has been sent, but no response has been received
beforeResponseProcessed: called once a response has been received, but prior to it being parsed / executed
onSuccess: called once a response has been received and verified to be a valid response
onFailure: called when the response indicates that an error occurred on the server
onRedirect: called when the response indicates that a redirect was requested by the server
onComplete: called when the response has been fully parsed, processed and executed