Is JavaScript multithreaded?

前端 未结 9 1952
误落风尘
误落风尘 2020-11-27 04:23

Here\'s my issue - I need to dynamically download several scripts using jQuery.getScript() and execute certain JavaScript code after all the scripts were loaded, so my plan

相关标签:
9条回答
  • 2020-11-27 05:22

    You can probably get some kind of multithreadedness if you create a number of frames in an HTML document, and run a script in each of them, each calling a function in the main frame that should make sense of the results of those functions.

    0 讨论(0)
  • 2020-11-27 05:26

    Currently JavaScript is not multithreaded, but the things will change in near future. There is a new thing in HTML5 called Worker. It allows you to do some job in background.

    But it's currently is not supported by all browsers.

    0 讨论(0)
  • 2020-11-27 05:26

    JS in general is single threaded. However HTML5 Web workers introduce multi-threading. Read more at http://www.html5rocks.com/en/tutorials/workers/basics/

    0 讨论(0)
提交回复
热议问题