簡體   English   中英

iframe“ src”屬性問題

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM