【问题标题】:Dojo 1.9 is not working on IE8, works flawlessly on IE9 onwardsDojo 1.9 无法在 IE8 上运行,但在 IE9 及更高版本上运行完美
【发布时间】:2014-09-07 19:35:51
【问题描述】:

我在 IE8 中使用 dojo 1.9 加载我的应用程序页面时遇到问题。从 IE9 开始,它可以在 Firefox 和 chrome 上完美运行。

控制台中抛出的错误是“LOG: Exception in Callback: Error: Member not found”,有时“'mid' is null or not an object”,页面停止渲染。

HTML 是:

<!DOCTYPE html>
<html>
<head>
<style> @import "../../../Scripts/dojolib/release/dijit/themes/claro/claro.css"; @import "../../../Scripts/dojolib/release/dijit/themes/dijit.css"; @import "../../../Scripts/dojolib/release/dgrid/css/dgrid.css"; </style><style type="text/css"> body { autofocus:false; } </style><meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<title>XYZ</title>
<link rel="stylesheet" href="../css/app-min.css">
<link rel="stylesheet" href="../css/systemsettings.css" />
<link rel="stylesheet" href="../css/pageLayout.css">
<link rel="stylesheet" href="../css/X420_style.css">
<script src='../../../Scripts/gw-app-config.js'></script><script src='../../../Scripts/dojolib/release/dojo/dojo.js'></script><script src='../scripts/gw-app.js'></script></head>
<body class="claro" >
<div id="maincontainer" class="container" style="width:1200px; margin: 0 auto; overflow: hidden; display: block;">
      <div id="body" class="row">
          <div class="wrapper">
              <div id="topBanner" data-dojo-type  = "dijit/layout/ContentPane"></div>
              <div id="topMenu"   data-dojo-type  = "dijit/layout/ContentPane"></div>
              <div id="content"   data-dojo-type  = "dijit/layout/ContentPane"></div>
              <div id="footer"    data-dojo-type  = "dijit/layout/ContentPane"></div>
          </div>
      </div>
</div>
</body>
</html>

请告诉我 IE8 中可能出现的问题以及如何调试此问题?

【问题讨论】:

    标签: javascript html internet-explorer-8 dojo dtd


    【解决方案1】:

    即使您发布了看起来像整个页面的内容,也无法进行测试,因为我们不知道在哪里,例如dojoConfig 指定。我相信它在 gw-app-config.js 文件中,但里面还有什么?

    关于您的问题,我注意到的第一件事是您的元标记不在层次结构的顶部,它们应该在头标记之后。这将是第一个测试建议。

    请查看此链接和第二个答案,这可能与您的问题不同,但类似 X-UA-Compatible is set to IE=edge, but it still doesn't stop Compatibility Mode

    【讨论】:

    • 是的@belzebu,我更正了元标记层次结构和其他内容,但问题仍然存在。有人知道如何快速分析IE不兼容的代码吗?
    • 我认为没有任何东西可以解析您的代码并突出显示 IE8 的任何可能问题。恐怕您将不得不逐个查看文件,甚至可能逐行查看失败的位置。根据我的经验,IE8 非常挑剔和无情,例如未终止的代码行或任何“次要”语法错误将阻止 IE 中的整个页面。
    【解决方案2】:

    经过大量调试后,我以 belzebu 突出显示的相同方式解决了这个问题。 IE8 打破了 Dojo 为 IE8 不支持的 CSS 字段(如背景、线性渐变)应用 CSS 样式的每条 Dojo 语句。 我还取消了使用 dom.byId() 并使用了 style.set() 我还用 IE8 和其他浏览器支持的 CSS 替换了 CSS。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-07
      • 2023-03-20
      • 2014-10-01
      • 2011-06-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多