因此,我正在.NET 4.5 的 WebForms 中使用 OpenLayers 编写一个 Web 地图应用程序。
在我的浏览器升级到 IE9 之前,它运行良好。现在 JavaScript 失败了。经过研究,我发现问题似乎在于 IE9 改变了它处理某些类型的 JavaScript 的方式。因此,在社区可以重写 JavaScript 库之前,解决方案似乎是让浏览器以兼容模式运行。不幸的是,我似乎无法让兼容模式正常工作。
目前我的应用程序有一页,这是标题:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="AgPlaceHolder._default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>Agrilogic Place Holder</title>
<script src="OpenLayers.js"></script>
<script src="AgInit.js"></script>
<script src="AgLabels.js"></script>
<style>
html, body
{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
它没有用。所以我找到了添加到 web.config 文件中的替代方法:
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=EmulateIE8"/>
</customHeaders>
</httpProtocol>
</system.webServer>
这也没有奏效。
我尝试了一些我见过的变体,但它们似乎都不起作用。有谁看到我可能做错了什么?或者有其他解决这个问题的方法?
谢谢。
新建的页面也有同样的错误。当我删除必应:
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'wrapDateLine': object is null or undefined
当我包括必应:
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'resources': object is null or undefined
我受制于你的专业知识。