Google Maps API V3 and Internet Explorer
Google Maps API V3 and Internet Explorer
我正在创建一个使用Google API的页面内使用wordpress的网站。
该地图适用于所有浏览器(Firefox,Chrome,Safari,Opera),但IE除外。
带有地图的页面是这样的
http://www.guicciardinistrozzi.it/tenute
如果我复制我链接的页面的源代码并将其复制到 html 文件中,IE 可以显示地图,就会发生奇怪的事情。
我们证明了 http://www.guicciardinistrozzi.it/tenute_/index.html
我试图用wordpress strandard的结构改变永久链接结构,但没有结果。
我使用的javascript脚本如下:
-
伊尼齐亚利扎.js
-
罗吉.js
地图的CSS代码是luoghi.css
你能尝试在你的标题中添加这个吗?
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
您的脚本插入不会在 IE 中发生。特别是,此行不起作用:
window.onload = loadScript;
如果手动执行loadScript
事件,将显示地图。特定于 IE 的内容可能是重写了 onload 事件。
查看没有jQuery的$(document).ready等效项,以获得将侦听器添加到onload事件的更好方法。
谢谢!问题是 window.onload 事件。我已经解决了这个问题,将此代码添加到我的 inizializza.js 文件中。
函数加载脚本() {
var script = document.createElement("script");
script.type = "text/javascript";
script.src ="http://maps.googleapis.com/maps/api/js?key=****&sensor=false&callback=initialize";
document.body.appendChild(script);
}
window.onload = loadScript;
IE(我添加的代码)
document.write("<script id=__ie_onload defer src=javascript:void(0)><'/script>");
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function() {
if (this.readyState == "complete") {
loadScript(); // call the onload handler
}
};
相关文章:
- 视频HTML没有'无法在Internet Explorer 11上工作
- Internet Explorer缺少占位符支持,特别是密码字段
- Internet Explorer中的文本换行错误
- 为什么我在Internet Explorer上看不到html元素
- internet explorer 8兼容模式下的Youtube api错误
- 当浏览器控制台未打开时,为什么要求会导致Internet Explorer 9超时
- Internet Explorer 8. Events
- jQuery表单验证适用于Mozilla和Internet Explorer,但不适用于Chrome或Safari
- element.dataset in Internet Explorer
- Facebook FB.init”;访问被拒绝”;在Internet Explorer 11中
- JavaScript不适用于internet explorer和Firefox,但适用于谷歌
- 在Internet Explorer中,向所选内容添加选项不起作用
- 在Internet Explorer中从二进制文件打开PDF
- elementproblem internet explorer
- 我可以使用哪些方法在Internet Explorer中禁用Alt+*X*
- 如何在Internet Explorer中使用javascript设置cookie
- 只有当alert()在带有AJAX的internet explorer中使用时,Javascript才会更新UI
- sharepoint站点的internet explorer中出现Javascript错误
- Internet Explorer重新加载IFrame
- 如何在不使用Internet Explorer的情况下从未挂起的HTML文件执行程序