Skip to content

Z.getJSON(...)

Studio is being deprecated, please head over to the documentation page for Mattercraft, our most advanced 3D tool for the web, where you can find the most recent information and tutorials.

Z.getJSON(url: string, success: (data?: any) => void, error?: (xhr?: any) => void);

Retrieves a JSON document from a URL.

For more information please see our Fetching JSON page.

We highly recommend using HTTPS for all calls using this function. In addition to the security benefits for your users, Apple are deprecating HTTP-only network connections from apps.

ParameterTypeDescription
urlstringThe address of the JSON to get.
successfunctionA function that will be called if the JSON is successfully retrieved. The function can be passed the JavaScript object that results from parsing the response.
errorfunctionA function that will be called if an error occurred in retrieving the document, or in parsing it.

XMLHttpRequest object.