[英]The iframe “src” attribute issue
我已经制作了小型iframe并链接到google.com,但我的代码无法正常工作
<iframe width="560" height="315" src="https://www.google.com.pk/" frameborder="0" allowfullscreen></iframe>
失误
Refused to display 'https://www.google.com.pk/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
www.google.com.pk/ Failed to load resource: net::ERR_BLOCKED_BY_RESPONSE
您输入的网址错误。 请参考下面的代码。 它可能会帮助您。
<iframe width="560" height="315" src="https://www.google.co.pk/" frameborder="0" allowfullscreen></iframe>
您的网址应为:“ https://www.google.co.pk ”。 您输入了:https:www.google.com.pk“。这是无效的网址。
出于安全原因,包括Google在内的许多网站都阻止自己在iframe中显示。
有关X-Frame-Options
的工作原理, 请参见此说明
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.