This demo demonstrate how to load JSON assets with Shaku.
Dynamically loading JSON files is very useful to store objects data and configuration, and load them from server.
The following content was loaded from a static JSON file:
The following content is a JSON asset we created via code at runtime:
The following is a code example on how to load a JSON assets.
// load json asset
let json = await Shaku.assets.loadJson("assets/json_example.json");
// get data from json (it's a dictionary once loaded)
alert(json.data.some_field);