2017-03-09 123 views
-1

我試圖將網站嵌入到iframe中以發佈到我的網站上。但由於某種原因,我試圖嵌入的網站無法正常工作。在iframe中嵌入網站

不工作(只顯示空白頁):

<iframe src="https://embeds.tagboard.com/newFLdriver/337842/" style="width: 100%; height: 5325px;" scrolling="no" frameborder="0"></iframe> 

這個網站的工作原理:

<iframe src="https://www.w3schools.com" style="width: 100%; height: 5325px;" scrolling="no" frameborder="0"></iframe> 

但是谷歌就不能工作。

任何幫助,將不勝感激!

+0

定義 「不工作」。 – deceze

+0

只顯示空白頁... –

+0

在控制檯中查看是否有錯誤。 –

回答

2

https://embeds.tagboard.com/newFLdriver/337842/拒絕嵌入到iframe中。

我的Chrome瀏覽器開發工具的控制檯告訴我:

Refused to display ' https://embeds.tagboard.com/newFLdriver/337842/ ' in a frame because it set 'X-Frame-Options' to 'DENY'.

除此之外,我得到一個404,這可能是他們的行爲。

1

有些網站不允許使用X-Policy。如果你檢查控制檯,你有這個錯誤:

拒絕在框架中顯示'https://embeds.tagboard.com/newFLdriver/337842/',因爲它將'X-Frame-Options'設置爲'DENY'。

你可以閱讀更多關於這個link

The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a , or . Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.