1
0
Fork 0
forked from 0x2620/oxjs

misc updates to ox.js

This commit is contained in:
rolux 2012-01-04 13:12:48 +05:30
commit 2ef642fdeb
11 changed files with 136 additions and 93 deletions

View file

@ -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?