Link Move in iframe

Asked 2 years ago, Updated 2 years ago, 72 views

<p><a href="https://www.google.co.jp/">Google.co.jp</a></p>

If there was an HTML file frame.html like the one above, I read it in the HTML below.

<html>
  <iframe src="frame.html"></frame>
</html>

Then the link will be displayed, but when you click it, the blank will be blank.
How can I avoid it?

html html5

2022-09-30 18:21

1 Answers

The reason why the page appears blank is because you are trying to display google.co.jp in a frame.
The google.co.jp page has SAMEORIGIN configured in the X-Frame-Options header and cannot be viewed in frames from another domain.
Because of this, it will be displayed white and difficult to avoid.
I think it can be displayed in browsers that do not support the X-Frame-Options header, but I think most browsers these days are already supported.

The X-Frame-Options header can be found at the following location in Chrome's Developer tools:

Chrome Developer tools

The X-Frame-Options header can be found at the following URL:
https://developer.mozilla.org/ja/docs/Web/HTTP/X-Frame-Options


2022-09-30 18:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.