zerk.jsonLoader Class
JSON Loader
Loads JSON resources via Ajax.
Item Index
Properties
Methods
_getResourcePath
(
String
protected
-
id
Returns the path for given resource id
This method is using the namespace configuration.
Parameters:
-
id
StringResource id
Returns:
String:
Path to resource
getResource
(
Object
-
id
Returns a preloaded resource
Parameters:
-
id
StringResource id
Returns:
Object:
The resource data
init
(
-
config
Class constructor
Parameters:
-
config
ObjectConfiguration object
isLoaded
(
Boolean
-
id
Returns true when resource is loaded already
Parameters:
-
id
StringResource id
Returns:
Boolean:
True when the resource is loaded already
loadResource
(
async
-
resource
-
successHandler
-
errorHandler
Loads one resource
Fires successHandler when the resource is loaded.
Parameters:
-
resource
StringResource id
-
successHandler
FunctionEvent handler for success
-
errorHandler
FunctionEvent handler for error
require
(
async
-
resources
-
successHandler
-
errorHandler
Loads multiple resources
Fires successHandler when all resources are loaded.
Parameters:
-
resources
ArrayArray of resource id's
-
successHandler
FunctionEvent handler for success
-
errorHandler
FunctionEvent handler for error
setConfig
(
-
config
Sets the namespace configuration
Parameters:
-
config
ObjectConfiguration object
Properties
_data
Object
protected
Register of loaded resources
_namespace
Object
protected
Namespace configuration