Here is the javascript implementation for the scriptDB API. It needs jQuery.

         *  methodType = "GET";
         */

		var dataType = "json";
        if(!postData) {
            u += "&callback=?";
            dataType = "jsonp";
        }

        var d = $.Deferred();
        var headers = oa2 ? { Authentication: 'Bearer ' + oa2.getAccessToken() } : {};   
        
        // application headers
        /*
        headers["X-scriptDb-Application-Id"] = pPackage.clientKey;
        headers["X-scriptDb-REST-API-Key"] = pPackage.restAPIKey;
        */
        $.ajax({
            type: methodType,
            dataType: dataType,
            url: u,
            success: function (data) {
                    d.resolve(data,defers);
                },
            error:function(res, status, err) {
                    d.reject("error " + err + " for " + url,defers);
                },
            headers: headers,
            data : postData
        });
        return d.promise();
    };
}

For help and more information join our forum, follow the blog or follow me on Twitter