简体   繁体   English

如何在我网站的博客中嵌入网站?

[英]How to embed a website in my site's blog?

I have a site with a blog and using an embed code:我有一个带有博客并使用嵌入代码的网站:

<embed src="https://www.timeout.com/london/things-to-do/the-best-life-drawing-classes-in-london" style="width:500px; height: 300px;"</embed>

This works fine.这工作正常。 But when I try:但是当我尝试:

<embed src="http://anyamountofbooks.com" style="width:500px; height: 300px;"</embed>

It doesn't work.它不起作用。

The site exists but, when I view the page on my blog, it says, 'this site may be down.该站点存在,但是,当我在我的博客上查看该页面时,它说,'该站点可能已关闭。

Typically you'll want to use an <iframe> instead of<embed> to display HTML content.通常,您需要使用<iframe>而不是<embed>来显示 HTML 内容。 Take a look at this answer for some more in depth analysis.看看这个答案进行更深入的分析。 Now to the root of your problem.现在到你问题的根源。

If you're embedding external content into your site (such as by iframe/embed), you'll need to make sure that the protocols match:如果您将外部内容嵌入您的网站(例如通过 iframe/embed),您需要确保协议匹配:

  • An http:// website can embed both http:// and https:// content. http://网站可以嵌入http://https://内容。
  • An https:// website can ONLY embed https:// content. https://网站只能嵌入https://内容。

The http://anyamountofbooks.com website doesn't appear to have a valid SSL certificate, so you won't be able to frame it if your website is secured and accessed through https:// . http://anyamountofbooks.com网站似乎没有有效的 SSL 证书,因此如果您的网站受到保护并通过https://访问,您将无法对其进行框架化。

The other thing to consider is that some websites don't allow themselves to be embedded, here's on article on a couple ways to do it.另一件要考虑的事情是有些网站不允许自己被嵌入, 这里有关于几种方法的文章 The website you're trying to embed may employ one of those practices to prevent itself from being embedded.您尝试嵌入的网站可能会采用其中一种做法来防止自身被嵌入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM