Home  >  Article  >  Web Front-end  >  How to dynamically add js files under IE_javascript skills

How to dynamically add js files under IE_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:02:181131browse

Here we only discuss the browsing situation that supports parallel downloading, which can be roughly divided into two types. One is executed in the order of adding to the DOM tree, and the other is executed in the order of download completion; in this way, if there are dependencies between js files , and is executed in the order of downloading, and an error will be reported if there is no cache (usually an error will be reported for the first execution, and http returns status 200. If the cache is not disabled and the http status is 304, no error will be reported. )
And IE executes the js code in the order in which the http download is completed. First look at the following code:

Copy code The code is as follows:





Model










      可以看出加载的3个js文件是并行下载的。
      对于其它浏览器有动态加载js文件的并行下载和顺序执行问题的情况,目前还没有相对完美的解决方案(如果有了请指教一下。。),单从这个方面,个人觉得ie的这个onreadystatechange事件方案相对好些。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn