XHRLoader.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <div class="desc">A low level class for loading resources with XmlHttpRequest, used internaly by most loaders.</div>
  13. <h2>Constructor</h2>
  14. <h3>[name]( [page:LoadingManager manager] )</h3>
  15. <div>
  16. [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
  17. </div>
  18. <div>
  19. Creates a new [name].
  20. </div>
  21. <h2>Properties</h2>
  22. <h3>[property:Cache cache]</h3>
  23. <div>
  24. A [page:Cache cache] instance that hold the response from each request made through this loader, so each file is requested once.
  25. </div>
  26. <h3>[property:String responseType]</h3>
  27. <div>
  28. Can be set to change the response type.
  29. </div>
  30. <h2>Methods</h2>
  31. <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
  32. <div>
  33. [page:String url] — required<br />
  34. [page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br />
  35. [page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
  36. [page:Function onError] — Will be called when load errors.<br />
  37. </div>
  38. <div>
  39. Begin loading from url and return the [page:String text] response that will contain the data.
  40. </div>
  41. <h3>[method:null setCrossOrigin]( [page:String value] )</h3>
  42. <div>
  43. [page:String value] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
  44. </div>
  45. <h3>[method:null setResponseType]( [page:String value] )</h3>
  46. <div>
  47. [page:String value] — the empty string (default), "arraybuffer", "blob", "document", "json", or "text".
  48. </div>
  49. <h2>Example</h2>
  50. [example:webgl_morphtargets_human]
  51. <h2>Source</h2>
  52. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  53. </body>
  54. </html>