Can I change/set the Google Maps API Key dynamically from JavaScript?

后端 未结 2 1573
长情又很酷
长情又很酷 2021-01-03 04:20

I\'m faced with a problem with a small web application I\'m developping: My HTML-source will be integrated into the HTML source on another site. I\'m using a Google Map in m

2条回答
  •  佛祖请我去吃肉
    2021-01-03 04:44

    Use

    var script = document.createElement("script");
    script.setAttribute("src",whatever);
    document.getElementsByTagName("head")[0].appendChild(script);
    

    Replace whatever with the script source you want to use

提交回复
热议问题