Is there a known workaround for IE9's execution order of injected script tags?

后端 未结 4 1926
無奈伤痛
無奈伤痛 2021-01-14 06:18

I am sure I don\'t fully understand this problem, but it seems that we are seeing strange behavior on IE9 on my project, somehow related to out-of-order execution o

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-14 06:37

    I guess you could chain the onload event of one to start the load of another:

    var newJS= document.createElement('script');
    newJS.onload=function() {alert("done")} //or call next load function
    newJS.src="..."
    document.body.appendChild(newJS)
    

提交回复
热议问题