首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用embed

如何使用embed
EN

Stack Overflow用户
提问于 2019-06-01 20:37:57
回答 1查看 217关注 0票数 0

我正在尝试使用<embed>,但收效甚微。例如,这两个URL不会嵌入。

代码语言:javascript
复制
<embed style="width: 500px; height: 300px;" 
  src="https://www.tate.org.uk" width="300" height="150">
</embed>
<embed style="width: 500px; height: 300px;" 
  src="http://www.northlondonreadinggroup.co.uk/" width="300" height="150">
</embed>

而其他URL将...

https://adsler.co.uk/adsler-blog/

我遇到了这些:How Can I Bypass the X-Frame-Options: SAMEORIGIN HTTP Header?如果我在我的站点标题中张贴它们,我可以绕过iframe限制吗?

代码语言:javascript
复制
<script 
src="https://unpkg.com/@ungap
/custom-elements-builtin"></script>
<script type="module" src="x-frame- 
bypass.js"></script>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-01 20:52:54

正如@showdev所提到的,您可以使用X-Frame-Options

以下是您的案例示例:

代码语言:javascript
复制
<!DOCTYPE html>
<html>
<script src="https://unpkg.com/@ungap/custom-elements-builtin"></script>
<script type="module" src="https://unpkg.com/x-frame-bypass"></script>
<body>

<h2>HTML Iframes</h2>
<p>You can use the height and width attributes to specify the size of the iframe:</p>

<iframe is="x-frame-bypass" src="https://www.tate.org.uk" height="150" width="300"></iframe>

<iframe is="x-frame-bypass" src="http://www.northlondonreadinggroup.co.uk/" height="150" width="300"></iframe>

</body>
</html>

下面是我提到的示例:(只需单击run)

https://www.w3schools.com/code/tryit.asp?filename=G4LYCU8V9ILG

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56406820

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档