很多地方能访问,可在这却出错了,郁闷呀!
下面的例子是:http://www.codechina.org/doc/google/gmapapi/ 的第一个例子。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=abcdefg"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[ function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
} //]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 500px; height: 300px"></div>
</body>
</html>错误提示:网页错误详细信息用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.0)
时间戳: Thu, 9 Jun 2011 10:37:02 UTC
消息: 'GMap2' 未定义
行: 14
字符: 9
代码: 0
URI: file:///C:/Documents%20and%20Settings/Administrator/桌面/新建文件夹%20(2)/新建文件夹%20(2)/a.html
下面的例子是:http://www.codechina.org/doc/google/gmapapi/ 的第一个例子。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=abcdefg"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[ function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
} //]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 500px; height: 300px"></div>
</body>
</html>错误提示:网页错误详细信息用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.0)
时间戳: Thu, 9 Jun 2011 10:37:02 UTC
消息: 'GMap2' 未定义
行: 14
字符: 9
代码: 0
URI: file:///C:/Documents%20and%20Settings/Administrator/桌面/新建文件夹%20(2)/新建文件夹%20(2)/a.html
如果传递的地址能够在google地图上找到,那没有问题,能正常显示
但如果地址不能够在google地图上找到,我界面上通过处理显示:地图暂无此数据
接着在传递一个能够解析的地址,就出现这样的脚本错误,郁闷,求解!