XHRLoader.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 crossOrigin]</h3>
  27. <div>
  28. The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
  29. </div>
  30. <h3>[property:String responseType]</h3>
  31. <div>
  32. Can be set to change the response type.
  33. </div>
  34. <h2>Methods</h2>
  35. <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
  36. <div>
  37. [page:String url] — required<br />
  38. [page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br />
  39. [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 />
  40. [page:Function onError] — Will be called when load errors.<br />
  41. </div>
  42. <div>
  43. Begin loading from url and return the [page:String text] response that will contain the data.
  44. </div>
  45. <h3>[method:null setCrossOrigin]( [page:String value] )</h3>
  46. <div>
  47. [page:String value] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
  48. </div>
  49. <h3>[method:null setResponseType]( [page:String value] )</h3>
  50. <div>
  51. [page:String value] — the empty string (default), "arraybuffer", "blob", "document", "json", or "text".
  52. </div>
  53. <h2>Example</h2>
  54. [example:webgl_morphtargets_human]
  55. <h2>Source</h2>
  56. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  57. </body>
  58. </html>