Class bbq.ajax.AJAXRequest

Defined in: AJAXRequest.js.

Wrapper for Prototype Ajax class which dds extras such as an independent server timeout and error handling.

Typically you would use a subclass such as bbq.ajax.JSONRequest.

See:
bbq.ajax.JSONRequest

Class Summary
Constructor Attributes Constructor Name and Description
 

Wrapper for Prototype Ajax class which dds extras such as an independent server timeout and error handling.

Field Summary
Field Attributes Field Name and Description
<static>  
bbq.ajax.AJAXRequest.errorHandlers
Add custom error handlers to this map.
 
Holds the options for this object.

Constructor Detail

bbq.ajax.AJAXRequest(options)

Parameters:
Name Type Comment
options {Object}
options.url {String} Where to send the request to.
options.method
Optional, Default: "post"
{String} "post" or "get".
options.args
Optional
{Object} key/value pairs.
options.onSuccess
Optional
{Function} Everything went as expected - eg. received HTTP 200.
options.onFailure
Optional
{Function} The call failed - eg. did not receive HTTP 200.
options.onException
Optional
{Function} An exception was thrown while attempting to make the call.
options.postBody
Optional
{String} A string to send as the body of the request. Subclasses will tend to use options.args over this value.
options.headers
Optional
{Object} A list of key/value pairs to send as request headers.
options.contentType
Optional
{String} The request content-type.
See:
bbq.ajax.JSONRequest

Field Detail

<static> bbq.ajax.AJAXRequest.errorHandlers

Add custom error handlers to this map. Error handlers should be a function with the following signature:

function(bbq.ajax.AJAXRequest, XMLHttpRequest);
See:
bbq.ajax.AJAXRequest

options

Holds the options for this object.