[name]

A low level class for loading resources with XmlHttpRequest.

Constructor

[name]([page:LoadingManager manager])

manager — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
Creates a new [name].

Properties

.[page:Cache cache]

A [page:Cache cache] instance that hold the response from each request made through this loader, so each file is requested once.

.[page:string crossOrigin]

The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.

.[page:string responseType]

Can be set to change the response type.

Methods

.load( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )

url — required
onLoad — Will be called when load completes. The argument will be the loaded text response.
onProgress — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
onError — Will be called when load errors.
Begin loading from url and return the [page:String text] response that will contain the data.

.setCrossOrigin([page:String value]

value — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.

.setResponseType([page:String value]

value — the empty string (default), "arraybuffer", "blob", "document", "json", or "text".

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]