0

我的以下内容在 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;
4

1 回答 1

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;
于 2014-02-24T18:04:43.497 回答