´╗┐The addb.js - ADDb through JavaScript

Including the addb.js

Start by including the addb.js by adding the following tag to your page. It can be placed either in your head-tag or anywhere in your body-tag.

Development Version (with comments)

<script src="http://assets.absolutdrinks.com/api/addb-0.5.2.js" type="text/javascript"></script>

Minified Production Version:

<script src="http://assets.absolutdrinks.com/api/addb-0.5.2.min.js" type="text/javascript"></script>

Initializing

The first thing you need to do before anything else is initializing addb.js with your settings. The only mandatory setting is the appId.

addb.init({
    appId: 5
});

All available settings are

Name Description Type Default Value
appId the id of your app number undefined
host the base host of all queries. string addb.absolutdrinks.com
assetsHost the base host to all media assets string assets.absolutdrinks.com
defaultPageSize the default page size of your queries result number 25

The settings can be changed after initialization by using the following convention.

addb.configuration.defaultPageSize = 10;

While Developing

ADDb uses the URL registered for your app to authorize your queries. While developing simply modify your "hosts" file.

Using addb.js

For more information on how to use addb.js to query for resources, check each individual resource for code examples.