Golem.de API

Golem  alpha

Golem.de API > Golem > Golem.Request
Search:
 
Filters

static Class Golem.Request

Base class for accessing the Golem web interface.

Before you can access a web service via doReqest() You must set your develeoper key via Golem_Request.KEY

Properties

DEBUG - {Boolean}

By default, the JS scripts as result of the JSONP request will be deleted after an successful request. To disable this behavoir, set the property to true.
Default Value: false

elHead - protected {Object HTMLElement}

Store the reference to the documents head element

ERROR_DATABASE - {Integer}

Indicates an internal data access problem.

ERROR_KEYAUTH_FAILED - {Integer}

Developer Key authentication failed

ERROR_KEYAUTH_LIMIT_EXCEEDED - {Integer}

Developer Key access limit exceeded

ERROR_KEYAUTH_NOT_ENABLED - {Integer}

Developer Key is suspended

ERROR_KEYAUTH_NOT_PROVIDED - {Integer}

Developer key was not provided with the request

ERROR_KEYAUTH_NOT_VALID - {Integer}

Developer key does not looks like one

fnCounter - protected {Integer}

Use a counter to create unique function names

fnList - protected {Array}

Keeps the list of anonymous functions as callback for the jsonp request. The standard implementation of jsonp requests adds the callback function to the global window scope. But having them in our namespace looks a little bit cleaner.

KEY - {String}

Holds the developer access key - MUST BE SET BEFORE ANY REQUEST

Methods

doRequest

Boolean doRequest ( url , params , callbackSuccessFn , callbackFailFn , timeout )
Does the request. The request is done via JSONP.
Parameters:
url <String> The URL of the web service
params <String> Additional GET-Parameters
callbackSuccessFn <Function> The function to call, after an succesful request. The first argument of the function will be the data property of the result.
callbackFailFn <Function> The function to call after the request could not proccessed. The first argument will be the error code, the second the message.
timeout <Object> object with the properties fn and duration. If duration is set, the request will have a timeout limit. If the request could not be processed, until the timeout expire, the fn-function will be called.
Returns: Boolean
true, if request could be successfully created - false, if neither a developer key was provides nor the documents head element was available.


Copyright © 2010 Golem.de.