实际上,jQuery(v1 和 v2 - 最新版本)面临着非常奇怪的行为。 我有一个管理内容的脚本,但当内容包含 iframe 时它会失败。
<article>
<section>some text with mixed tags and an <iframe /> </section>
</article>
<script>
$('section').each(function() {
console.log( $(this).html() )
});
</script>
这将返回未定义
我是否缺少一些在这些情况下使用的解决方法?
最佳答案
iframe 的 open 标签在哪里?
<section>some text with mixed tags and an <iframe /> </section>
更新
正如@Mike c(谢谢迈克)纠正我的问题是你的自闭标签 <iframe />
关于javascript - jQuery html() 在 iframe 中失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37171068/