Can dynamic loading of js guarantee the execution order?

there is a scenario where I need to dynamically load a list of js resources and make sure that they are executed in order, starting with
clipboard.png

clipboard.png

.

but does this guarantee the order of execution? For example, jquery must guarantee the first execution?

ask for advice

Apr.08,2022

script plus defer attribute


parallel loading and sequential execution.
after everything has been loaded, the js is executed sequentially.


method of patting the head: Promise.all asynchronously requests js and then takes back the string and then eval in its own order


refer to the class script tag, asynchronous loading, sequential execution , in which the successful callback of ajax can be replaced with your onload event


.

add this line:

  

you can use recursion to load js files sequentially. Each time a file is loaded, the load function is called recursively within the onload method

Menu