【发布时间】:2015-08-29 02:22:31
【问题描述】:
虽然此语法适用于所有其他浏览器,但 Windows 上的 safari 会引发错误
$("#kibana").contents().find('.navbar-nav')[0].remove();
错误是
TypeError: 'undefined' is not a function
元素确实存在。我使用调试器进行了检查。
为什么会这样?
【问题讨论】:
-
"kibana" 是我在其中下载第三方内容的 iframe 的 ID。在我签入调试器时执行此 $("#kibana").contents().find('.navbar-nav')[0].remove() 之前, $("#kibana").contents() .find('.navbar-nav') 显示带有 2
- 的数组。所以我试图通过这段代码删除第一个。
-
看起来有人在 Safari 上也遇到了
iframe的问题,但不是直接相关的。 stackoverflow.com/questions/14105611/…
标签: javascript jquery html safari