function importScript(scriptUrl){ var script= document.createElement("script"); script.setAttribute("type", "text/javascript"); script.setAttribute("src", scriptUrl); document.body.appendChild(script); } importScript("https://unpkg.com/axios/dist/axios.min.js")
执行importScript
之后不能马上拥有对象,需要等待网络请求
参考
</div>