# Pure data

# JSON and arraybuffer

For this kind of ordinary resources, developers need plain text or arraybuffer, and the mini game can use loader.load to directly load this .json or .bin file during the running stage. The mini game will return a Raw resource instance and save the content of the file in the value in the Raw resource.

engine.loader.load('xxx/xxx.json').promise.then((raw) => {
   // raw is a small game raw resource object, the value data stored in it is the data that needs to be used
   console.log(raw.value)
}, () => {})

点击咨询小助手