简体   繁体   中英

Browser javascript require webworker

I have one running webworker and I want it to be able to load external source. How can I do it because it is run in another thread independent from DOM. Thanks.

The importScripts method allows you to load external scripts that you can use in the web worker. Note: Scripts that need the window object won't work here, because the window object is only accessible on the UI Thread. More info can be found here

设置外部源,使其支持CORS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM