【发布时间】:2015-09-29 18:16:11
【问题描述】:
我在本地搜索应用程序中使用谷歌搜索 JSAPI。在除 IE 8 之外的所有浏览器中一切正常。问题出在我的 jquery 基础对象和 google 对象被引用的特定代码行之后。
这是一个直截了当的代码。我可以使用this jsfiddle 重现问题。
html代码是
<html>
<head>
<title>Test Map</title>
<script src="http://www.google.com/jsapi?" type="text/javascript"></script>
</head>
<body>
<div id="map_canvas"></div>
</body>
</html>
和JS
$(function() {
alert(1);
google.load('search',1);
alert($);
google.setOnLoadCallback(function() {
alert(2);
});
});
google.load('search',1) 之后出现以下错误
Error: Object doesn't support this property or method
在$ 和google 上。
这完全是一场噩梦。我在没有运气的情况下与这个斗争了几个小时。这里有任何 IE 专家有想法吗?
【问题讨论】:
标签: javascript internet-explorer google-api