Requests.js: update documentation

This commit is contained in:
rolux 2013-12-05 00:31:18 +01:00
parent a737bca563
commit 78aaaea9d3

View file

@ -42,10 +42,12 @@ Ox.getAsync <f> Runs an asynchonous loader for an array of URLs
code <n> Status code code <n> Status code
text <s> Status text text <s> Status text
callback <f> Callback function callback <f> Callback function
results <*|o|null> Result(s), or `null` on error result <*|o|null> Result(s), or `null` on error
For multiple URLs, keys are URLs, values are results, `{}` on error For multiple URLs, keys are URLs, values are results, `{}` on error
errors <o|null> Error(s), or `null` on success error <o|null> Error(s), or `null` on success
For multiple URLs, keys are URLs, values are errors, `{}` on success For multiple URLs, keys are URLs, values are errors, `{}` on success
code <n> Error code (like `404`)
text <s> Error text (like `'Not Found'`)
@*/ @*/
Ox.getAsync = function(urls, get, callback) { Ox.getAsync = function(urls, get, callback) {
urls = Ox.makeArray(urls); urls = Ox.makeArray(urls);
@ -208,10 +210,12 @@ Ox.getJSON <f> Get and parse one or more remote JSON files
(url, callback) -> <u> undefined (url, callback) -> <u> undefined
url <s|a> One or more remote URLs url <s|a> One or more remote URLs
callback <f> Callback function callback <f> Callback function
data <*|o|null> The parsed content of the remote resource(s) data <*|o|null> Parsed contents, or `null` on error
For multiple URLs, keys are URLs, values are parsed contents For multiple URLs, keys are URLs, values are data, `{}` on error
error <o|null> Error(s) error <o|null> Error(s), or `null` on success
For multiple URLs, keys are URLs, values are error objects For multiple URLs, keys are URLs, values are errors, `{}` on success
code <n> Error code (like `404`)
text <s> Error text (like `'Not Found'`)
@*/ @*/
Ox.getJSON = function(url, callback, isJSONC) { Ox.getJSON = function(url, callback, isJSONC) {
var urls = Ox.makeArray(url); var urls = Ox.makeArray(url);
@ -230,10 +234,12 @@ Ox.getJSONC <f> Get and parse a remote JSONC file
(url, callback) -> <u> undefined (url, callback) -> <u> undefined
url <s|a> One or more remote URLs url <s|a> One or more remote URLs
callback <f> Callback function callback <f> Callback function
data <*|o|null> The parsed content of the remote resource(s) data <*|o|null> Parsed contents, or `null` on error
For multiple URLs, keys are URLs, values are parsed contents For multiple URLs, keys are URLs, values are data, `{}` on error
error <o|null> Error(s) error <o|null> Error(s), or `null` on success
For multiple URLs, keys are URLs, values are error objects For multiple URLs, keys are URLs, values are errors, `{}` on success
code <n> Error code (like `404`)
text <s> Error text (like `'Not Found'`)
@*/ @*/
Ox.getJSONC = function(url, callback) { Ox.getJSONC = function(url, callback) {
Ox.getJSON(url, callback, true); Ox.getJSON(url, callback, true);
@ -245,10 +251,12 @@ Ox.getJSONP <f> Get and parse one or more remote JSONP files
url <s|a> One or more remote URLs url <s|a> One or more remote URLs
{callback} gets replaced with jsonp callback function name {callback} gets replaced with jsonp callback function name
callback <f> Callback function callback <f> Callback function
data <*|o|null> The parsed content of the remote resource(s) data <*|o|null> Parsed contents, or `null` on error
For multiple URLs, keys are URLs, values are parsed contents For multiple URLs, keys are URLs, values are data, `{}` on error
error <o|null> Error(s) error <o|null> Error(s), or `null` on success
For multiple URLs, keys are URLs, values are error objects For multiple URLs, keys are URLs, values are errors, `{}` on success
code <n> Error code (like `404`)
text <s> Error text (like `'Not Found'`)
@*/ @*/
Ox.getJSONP = function(url, callback) { Ox.getJSONP = function(url, callback) {
var urls = Ox.makeArray(url); var urls = Ox.makeArray(url);