我想使用优先级加载资源。我编写了一个抽象类,它将使用优先级处理 preloadjs 队列。
有没有更好的方法来实现这个目标?
最佳答案
查看 LoadQueue.js
的文档.
这里提到使用 maintainScriptOrder
属性,如下所示。
* var queue = new createjs.LoadQueue();
* queue.setMaxConnections(3); // Set a higher number to load multiple items at once
* queue.maintainScriptOrder = true; // Ensure scripts are loaded in order
* queue.loadManifest([
* "script1.js",
* "script2.js",
* "image.png", // Load any time
* {src: "image2.png", maintainOrder: true} // Will wait for script2.js
* "image3.png",
* "script3.js" // Will wait for image2.png before loading (or completing when loading with XHR)
* ]);
关于javascript - 如何使用preloadjs优先加载资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48048064/