對於我的問題,可能有一個簡單的答案,儘管任何幫助將不勝感激。使用Google.Load的Google地球插件()
我用我的GE插件使用ExtJs。爲了讓插件正常工作,我需要在我的主HTML頁面中包含以下內容。
<!DOCTYPE html>
<!-- Auto Generated with Sencha Architect -->
<!-- Modifications to this file will be overwritten. -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MDS</title>
<script src="https://www.google.com/jsapi" id="GoogleEarth"></script>
<script src="/static/googleearth/Ext.ux.GEarthPanel-1.3.js" id="GoogleEarth"> </script>
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript">
google.load("earth", "1");
google.load("maps", "2.xx");
</script>
</head>
<body></body>
</html>
現在,當我想刪除下面的代碼,並嘗試運行它作爲單獨的JavaScript頁面似乎繼續加載。
<script type="text/javascript">
google.load("earth", "1");
google.load("maps", "2.xx");
</script>
即使我刪除代碼並將其粘貼到它自己的.js文件中,問題仍然存在。
例如使用
<script type="text/javascript" src="/static/GoogleEarthStartup.js" id="Test"></script>
與內容,如
google.load("earth", "1");
google.load("maps", "2.xx");
它似乎想留在主網頁的腳本標記。
無論如何我可以解決這個問題嗎?
我問的主要原因是我使用了一個包裹,每當我保存該項目時會覆蓋我的主html。
該軟件包允許我通過鏈接添加腳本,如上所示,雖然它不會影響結果。
我得到一個錯誤說類型錯誤:google.earth未定義
請指點。