gs.Data Class
This class is used to load Data files which are stored as JSON files in the data-folder of the project as well as raw text data.
Constructor
gs.Data
()
Methods
load
(
-
uid
-
callback
Loads a data file asynchronously.
Parameters:
-
uid
StringThe UID of the data-file to load.
-
callback
FunctionA callback function called if the loading-process has been finish. It has the following signature:
// dataObject - A JavaScript Object which is the parsed JSON from the Data file or null if an error occurred. // error - The error object or null if no error occurred. function(dataObject, error) {}
loadRaw
(
-
filePath
-
callback
Loads a file as raw text asynchronously.
Parameters:
-
filePath
StringThe path/url to the file to load.
-
callback
FunctionA callback function called if the loading-process has been finish. It has the following signature:
// text - The content of the file as text or null if an error occurred. // error - The error object or null if no error occurred. function(dataObject, error) {}