Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

1.document.write肯定不行,虽然能够保证先后执行顺序,但会重绘整个document
2.appendto也不行,不能保证js的执行顺序


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
810 views
Welcome To Ask or Share your Answers For Others

1 Answer

楼主可以看看seajs,能满足你的这个要求

我觉得楼主要保证JS执行顺序这个想法,其实是可以通过代码打包解决的

将代码打包成一个文件,然后里面的主入口文件调用其他代码来执行

有很多现成的解决方案,webpack,rollup,browserify等等


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...