API Docs for:
Show:

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

()

Item Index

Methods

Methods

load

(
  • uid
  • callback
)

Loads a data file asynchronously.

Parameters:

  • uid String

    The UID of the data-file to load.

  • callback Function

    A 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 String

    The path/url to the file to load.

  • callback Function

    A 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) {}