【问题标题】:Cannot run script after iframe [duplicate]iframe 后无法运行脚本 [重复]
【发布时间】:2017-05-22 20:06:25
【问题描述】:

这是我的代码:

<iframe style="width:100%; height:500px;"/>
<script>console.log("prpr")</script>

当我运行google-chrome /home/roroco/Dropbox/jss/ro-wemedia/ex/test-keydown-for-iframe.html 时,我在 chrome 控制台中没有找到任何输出,如何在 iframe 之后运行脚本?

【问题讨论】:

标签: javascript html


【解决方案1】:

您的iframe没有关闭。

<iframe style="width:100%; height:500px;"></iframe>
<script>console.log("prpr")</script>

【讨论】:

  • 很确定&lt;iframe&gt;&lt;/iframe&gt; 是正确的语法。 :)
  • 正确; iframe 不是自闭合元素。
猜你喜欢
  • 1970-01-01
  • 2021-05-30
  • 2015-03-24
  • 2013-11-30
  • 2021-05-23
  • 2016-02-06
  • 1970-01-01
  • 1970-01-01
  • 2023-03-14
相关资源
最近更新 更多