build/tincan.js
function (cfg) {
            this.log("moreStatements: " + cfg.url);
            var requestCfg,
                requestResult,
                callbackWrapper,
                parsedURL,
                serverRoot;

            cfg = cfg || {};

            // to support our interface (to support IE) we need to break apart
            // the more URL query params so that the request can be made properly later
            parsedURL = TinCan.Utils.parseURL(cfg.url, { allowRelative: true });

            // Respect a more URL that is relative to either the server root
            // or endpoint (though only the former is allowed in the spec)
            serverRoot = TinCan.Utils.getServerRoot(this.endpoint);
            if (parsedURL.path.indexOf("/statements") === 0){
                parsedURL.path = this.endpoint.replace(serverRoot, "") + parsedURL.path;
                this.log("converting non-standard more URL to " + parsedURL.path);
            }

            // The more relative URL might not start with a slash, add it if not
            if (parsedURL.path.indexOf("/") !== 0) {
                parsedURL.path = "/" + parsedURL.path;
            }

            requestCfg = {
                method: "GET",
                // For arbitrary more URLs to work, we need to make the URL absolute here
                url: serverRoot + parsedURL.path,
                params: parsedURL.params
            };
            if (typeof cfg.callback !== "undefined") {
                callbackWrapper = function (err, xhr) {
                    var result = xhr;

                    if (err === null) {
                        result = TinCan.StatementsResult.fromJSON(xhr.responseText);
                    }

                    cfg.callback(err, result);
                };
                requestCfg.callback = callbackWrapper;
            }

            requestResult = this.sendRequest(requestCfg);
            requestResult.config = requestCfg;

            if (! callbackWrapper) {
                requestResult.statementsResult = null;
                if (requestResult.err === null) {
                    requestResult.statementsResult = TinCan.StatementsResult.fromJSON(requestResult.xhr.responseText);
                }
            }

            return requestResult;
        }
function (cfg) {
            this.log("moreStatements: " + cfg.url);
            var requestCfg,
                requestResult,
                callbackWrapper,
                parsedURL,
                serverRoot;

            cfg = cfg || {};

            // to support our interface (to support IE) we need to break apart
            // the more URL query params so that the request can be made properly later
            parsedURL = TinCan.Utils.parseURL(cfg.url, { allowRelative: true });

            // Respect a more URL that is relative to either the server root
            // or endpoint (though only the former is allowed in the spec)
            serverRoot = TinCan.Utils.getServerRoot(this.endpoint);
            if (parsedURL.path.indexOf("/statements") === 0){
                parsedURL.path = this.endpoint.replace(serverRoot, "") + parsedURL.path;
                this.log("converting non-standard more URL to " + parsedURL.path);
            }

            // The more relative URL might not start with a slash, add it if not
            if (parsedURL.path.indexOf("/") !== 0) {
                parsedURL.path = "/" + parsedURL.path;
            }

            requestCfg = {
                method: "GET",
                // For arbitrary more URLs to work, we need to make the URL absolute here
                url: serverRoot + parsedURL.path,
                params: parsedURL.params
            };
            if (typeof cfg.callback !== "undefined") {
                callbackWrapper = function (err, xhr) {
                    var result = xhr;

                    if (err === null) {
                        result = TinCan.StatementsResult.fromJSON(xhr.responseText);
                    }

                    cfg.callback(err, result);
                };
                requestCfg.callback = callbackWrapper;
            }

            requestResult = this.sendRequest(requestCfg);
            requestResult.config = requestCfg;

            if (! callbackWrapper) {
                requestResult.statementsResult = null;
                if (requestResult.err === null) {
                    requestResult.statementsResult = TinCan.StatementsResult.fromJSON(requestResult.xhr.responseText);
                }
            }

            return requestResult;
        }
function ( cfg ) { this . log ( "moreStatements: " + cfg . url ) ; var requestCfg , requestResult , callbackWrapper , parsedURL , serverRoot ; cfg = cfg || { } ; // to support our interface (to support IE) we need to break apart // the more URL query params so that the request can be made properly later parsedURL = TinCan . Utils . parseURL ( cfg . url , { allowRelative : true } ) ; // Respect a more URL that is relative to either the server root // or endpoint (though only the former is allowed in the spec) serverRoot = TinCan . Utils . getServerRoot ( this . endpoint ) ; if ( parsedURL . path . indexOf ( "/statements" ) === 0 ) { parsedURL . path = this . endpoint . replace ( serverRoot , "" ) + parsedURL . path ; this . log ( "converting non-standard more URL to " + parsedURL . path ) ; } // The more relative URL might not start with a slash, add it if not if ( parsedURL . path . indexOf ( "/" ) !== 0 ) { parsedURL . path = "/" + parsedURL . path ; } requestCfg = { method : "GET" , // For arbitrary more URLs to work, we need to make the URL absolute here url : serverRoot + parsedURL . path , params : parsedURL . params } ; if ( typeof cfg . callback !== "undefined" ) { callbackWrapper = function ( err , xhr ) { var result = xhr ; if ( err === null ) { result = TinCan . StatementsResult . fromJSON ( xhr . responseText ) ; } cfg . callback ( err , result ) ; } ; requestCfg . callback = callbackWrapper ; } requestResult = this . sendRequest ( requestCfg ) ; requestResult . config = requestCfg ; if ( ! callbackWrapper ) { requestResult . statementsResult = null ; if ( requestResult . err === null ) { requestResult . statementsResult = TinCan . StatementsResult . fromJSON ( requestResult . xhr . responseText ) ; } } return requestResult ; }
Fetch more statements from a previous query, when used from a browser sends to the endpoint using the
RESTful interface.  Use a callback to make the call asynchronous.

@method moreStatements
@param {Object} [cfg] Configuration used to query
@param {String} [cfg.url] More URL
@param {Function} [cfg.callback] Callback to execute on completion
@param {String|null} cfg.callback.err Error status or null if succcess
@param {TinCan.StatementsResult|XHR} cfg.callback.response Receives a StatementsResult argument
@return {Object} Request result
Fetch more statements from a previous query when used from a browser sends to the endpoint using the RESTful interface . Use a callback to make the call asynchronous .