Javascript, execute scripts code in order inserted into dom tree

前端 未结 5 1537
囚心锁ツ
囚心锁ツ 2021-01-06 05:47

NOT A DUPLICATE AS I HAVE YET TO FOUND A SATISFYING ANSWER ON OTHER THREADS:

  • Load and execute javascript code SYNCHRONOUSLY
  • Loading HTML and Script o
5条回答
  •  梦谈多话
    2021-01-06 06:07

    cant you nest the loading using ur callbacks?

    ie:

    loadScript("http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js",function() {
        alert(1);
        loadScript("http://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js",function() {
            alert(2);  
        })
    })
    

提交回复
热议问题