我有以下内容在Chrome / Safari / Firefox中正常加载,但无法在IE 8中启动。任何关于错误的想法?
function loadScript() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&' +
'callback=initialize';
document.body.appendChild(script);
}
window.onload = loadScript;
答案 0 :(得分:0)
function loadScript() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&' +
'callback="initialize"'; // added quotes around "initialize"
document.body.appendChild(script);
}
window.onload = loadScript;