单击链接时,链接将在浏览器的新选项卡上打开,而不是在iframe
中打开,iframe
是一个空白框
<iframe name="iframenew" height="300px" width="100%" title="Iframe Example"></iframe>
<p><a href="https://alight.com" target="iframenew">AVA</a></p>
我希望链接在iframe
本身中打开
您指的是消息alight.com refused to connect.
吗?
有些网站禁用嵌入iframe
,您可以使用X-Frame-Options
进行检查
在尝试将iFrame嵌入课程时,您可能偶尔会遇到一些错误,例如看到空白的白框或错误通知。这是因为并非所有网站都可以嵌入。
<iframe name="iframenew" height="300px" width="100%" title="Iframe Example"></iframe>
<p><a href="https://alight.com" target="iframenew">AVA</a></p>
代码没有错,你可以在下面看到,我把链接切换到维基百科主页,它会工作的。
<iframe name="iframenew" height="300px" width="100%" title="Iframe Example"></iframe>
<p><a href="https://en.wikipedia.org/wiki/Main_Page" target="iframenew">AVA</a></p>