Golem.de API

Golem  alpha

Golem.de API > Golem > Golem.Request

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


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


Indicates an internal data access problem.


Developer Key authentication failed


Developer Key access limit exceeded


Developer Key is suspended


Developer key was not provided with the request


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



Boolean doRequest ( url , params , callbackSuccessFn , callbackFailFn , timeout )
Does the request. The request is done via JSONP.
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.