【发布时间】:2014-11-27 08:26:01
【问题描述】:
大家早上好,
我正在尝试使用 Internet Explorer 打开一个 HTML 文件(请不要介意版本,我已经尝试过所有这些文件)。
该 HTML 文件使用 javascript 代码在 div 中创建 Google 地图,但每次我尝试使用 Internet Explorer 打开它时,浏览器都会显示以下消息:
“Internet Explorer 已阻止此页面运行可能访问您计算机的脚本或 ActiveX 控件。”
我已尝试更改安全和隐私选项,但消息仍在显示。
这是我现在使用的 javascript 代码:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script>
var directionsDisplay;
var directionsService = new google.maps.DirectionsService();
function initialize() {
directionsDisplay = new google.maps.DirectionsRenderer();
var mapOptions = {
zoom: 12,
center: new google.maps.LatLng(40.4889323, -3.6927295),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
directionsDisplay.setMap(map);
calcRoute();
}
function calcRoute() {
var start = new google.maps.LatLng(40.4889323, -3.6927295);
var end = new google.maps.LatLng(40.5485301,-3.648655);
var request = {
origin: start,
destination: end,
waypoints: [
{
location: new google.maps.LatLng(40.662707,-3.771187),
stopover: true
}
],
travelMode: google.maps.TravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
如果有人可以帮助我或给我一些建议,我将非常感激。
非常感谢您。
【问题讨论】:
-
您是否尝试过禁用 XSS 过滤器?一种。打开 Internet Explorer。湾。单击工具,然后单击 Internet 选项。 C。切换到安全选项卡。 d。选择互联网区域。 e.单击自定义级别。 F。在脚本下,选择启用 XSS 过滤器下的单选按钮“禁用”。 G。单击“确定”保存更改。
标签: javascript html google-maps internet-explorer