我希望你今天过得愉快!我正在尝试将新的Google网站嵌入到另一个网页中。我正在尝试使用iframe嵌入Google网站,但它不起作用。
代码行:
<iframe width="1280" height="720" src="https://sites.google.com/view/dm-viewer-samples" frameborder="0" scrolling="yes"></iframe>
控制台错误:
拒绝在一个框架中显示'https://accounts.google.com/ServiceLogin?passive=1209600&continue=https://sites.google.com/s/1qcUAedTDdwcpfVAuSclwMF0K0bM2o2Lq/edit?userId%3D0',因为它将'X-Frame-Options'设置为'DENY'。
正如在this帖子回答中所述,由于HTTP标头,您无法将此网站包含在iframe中:
X-Frame-Options: SAMEORIGIN