1
我遇到了一個奇怪的錯誤。我試圖加載谷歌地球庫,但這樣做時,我得到錯誤「ERR_CREATE_PLUGIN」Google地球「ERR_CREATE_PLUGIN」
下面的代碼不工作:
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("earth", "1");
var ge = null;
function init() {
google.earth.createInstance("map3d", initCallback, failureCallback);
}
function initCallback(object) {
ge = object;
ge.getWindow().setVisibility(true);
}
function failureCallback(object) {
}
</script>
</head>
<body onload='init()' id='body'>
<center>
<div id='map3d'
style='border: 1px solid silver; height: 600px; width: 800px;'></div>
</center>
</body>
儘管此代碼不:
<script type="text/javascript">
google.load("earth", "1");
var ge = null;
function initCallback(object) {
ge = object;
ge.getWindow().setVisibility(true);
}
function failureCallback(object) {
}
$(document).ready(function() {
google.earth.createInstance("map3d", initCallback, failureCallback);
});
</script>