forked from 0x2620/oxjs
misc updates to ox.js
This commit is contained in:
parent
d64e39c5b2
commit
2ef642fdeb
11 changed files with 136 additions and 93 deletions
|
|
@ -31,7 +31,7 @@ Ox.getJSON <f> Get and parse a remote JSON file
|
|||
(url, callback) -> <u> undefined
|
||||
url <s> Remote URL
|
||||
callback <f> Callback function
|
||||
data <s> The contents of the remote resource
|
||||
data <s> The parsed contents of the remote resource
|
||||
@*/
|
||||
Ox.getJSON = function(url, callback) {
|
||||
Ox.get(url, function(data) {
|
||||
|
|
@ -39,6 +39,14 @@ Ox.getJSON = function(url, callback) {
|
|||
});
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.getJSONC <f> Get and parse a remote JSONC file
|
||||
JSONC is JSON with JavaScript line or block comments
|
||||
(url, callback) -> <u> undefined
|
||||
url <s> Remote URL
|
||||
callback <f> Callback function
|
||||
data <s> The parsed contents of the remote resource
|
||||
@*/
|
||||
Ox.getJSONC = function(url, callback) {
|
||||
Ox.get(url, function(data) {
|
||||
callback(JSON.parse(Ox.minify(data)));
|
||||
|
|
@ -53,7 +61,6 @@ Ox.loadFile <f> Loads a file (image, script or stylesheet)
|
|||
file <s> Local path or remote URL
|
||||
callback <f> Callback function
|
||||
@*/
|
||||
|
||||
Ox.loadFile = (function() {
|
||||
// fixme: this doesn't handle errors yet
|
||||
// fixme: rename to getFile?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue