XHRLoader.html 2.4 KB

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