動(dòng)態(tài)加載

2019-02-20 15:31 更新

動(dòng)態(tài)加載Fundebug插件可以這樣實(shí)現(xiàn):

<script type="text/javascript">

function loadScript(url, apikey) {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = url;
    script.setAttribute("apikey", apikey);
    document.body.appendChild(script);
}

loadScript("https://js.fundebug.cn/fundebug.1.5.1.min.js", "API-KEY")
</script>

注意,apikey需要使用setAttribute方法進(jìn)行配置。


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)