【问题标题】:targetElem.innerHTML Unknown Runtime Error in IE8IE8 中的 targetElem.innerHTML 未知运行时错误
【发布时间】:2013-09-03 13:58:31
【问题描述】:

我在 Windows 7 VM 上的 IE8 中收到“未知运行时错误”。

这是我的jsFiddle

错误提示:

未知的运行时错误。 DmiAjax.js,第 317 行,字符 9

另外,为了帮助可视化,这里是所述错误的屏幕截图:

当我点击“获取报价”按钮时出现错误,如下所示:

 <input type="button" OnClick="javascript:populateCartTotalInCartPage();toggleTable();" value="Get Quotes" class="btn btn-orange">

【问题讨论】:

  • 没有必要使用javascript:。摆脱它。更好的是,做起来不显眼。
  • 您的小提琴在控制台中有很多错误。 JavaScript 部分中不应有脚本标记。
  • 不了解 IE,但在 chrome 中我得到了那个小提琴:Uncaught TypeError: Cannot read property 'value' of undefined
  • 这已在 [这里][1] [1] 中得到解答:stackoverflow.com/a/13818214/2621192

标签: javascript jquery html css internet-explorer-8


【解决方案1】:

这个问题已经被问了很多,也得到了很多回答。 IE8中不能直接修改表格的innerHtml。 见:

InnerHTML issue in IE8 and below

Why is document.getElementById('tableId').innerHTML not working in IE8?

等等……

【讨论】:

  • 有趣。你建议我做什么来获得我正在寻找的影响?我希望隐藏表格,直到单击“获取报价”按钮,然后显示表格。
  • 只使用“display: none”?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-16
  • 2016-04-20
  • 1970-01-01
  • 2021-08-14
  • 2012-12-09
  • 1970-01-01
相关资源
最近更新 更多