简体   繁体   中英

The iframe “src” attribute issue

I have make the small iframe and link to google.com but it is no working my code is

<iframe width="560" height="315"  src="https://www.google.com.pk/" frameborder="0" allowfullscreen></iframe>

Errors

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

You are entering wrong url. Please refer below code. It may help you.

<iframe width="560" height="315"  src="https://www.google.co.pk/" frameborder="0" allowfullscreen></iframe>

Your url should be: " https://www.google.co.pk ". Yo have entered: https:www.google.com.pk" It is invalid url.

Lots of websites, Google included, block themselves from being displayed in iframes for security reasons.

See this description for X-Frame-Options for how it works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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