Namespace: ajax

og.ajax

Ajax parameters.

Classes

Xhr

Members

staticog.ajax.Asynchronousboolean

Ajax query type is asynchronous.

staticog.ajax.Method

Ajax query method.
Properties:
Name Type Default Description
Get GET
Post POST

staticog.ajax.ReadyState

Ajax ready state result.
Properties:
Name Type Default Description
Uninitialized 0
Loading 1
Loaded 2
Interactive 3
Complete 4

staticog.ajax.Status

Ajax status code.
Properties:
Name Type Default Description
OK 200
Created 201
Accepted 202
NoContent 204
BadRequest 400
Forbidden 403
NotFound 404
Gone 410
ServerError 500

staticog.ajax.Synchronousboolean

Ajax query type is synchronous.

Methods

staticog.ajax.request(url, params){og.ajax.Xhr}

Send an ajax request.
Name Type Description
url string Url path.
params Object optional Ajax parameters:
Name Type Description
type og.ajax.Method | string optional 'POST' or 'GET' ajax method. 'GET' is default.
async boolean optional Asynchronous ajax flag. True is default.
data Object optional Qery data.
sender Object optional Sender object, that success callback binded with. ActiveXObject is default.
responseType string optional Responce data type. Culd be 'text', 'json', 'jsonp', 'html'. 'text' is default.
success og.ajax.Xhr~successCallback optional The callback that handles the success response.
error og.ajax.Xhr~errorCallback optional The callback that handles the failed response.
abort og.ajax.Xhr~abortCallback optional The callback that handles aborted requests.
Returns:
Type Description
og.ajax.Xhr - Returns object that could be aborted.