S
S
Sergey Eremin2016-05-03 01:33:23
Django
Sergey Eremin, 2016-05-03 01:33:23

iframe does not work ... From the word at all! What's the magic?

Some kind of magic... Clients asked for the widget of my oknardia.ru service ... In order to do everything quickly and not to fence the garden, I decided to do everything with the help of <iframe>, and get confused with asynchronous JS later. I have not been engaged in web development for a long time, I abandoned it 15 years ago and returned to site building a year ago. But I remembered that there were no problems with the iframe, and therefore I did not foresee problems now. I created a site for debugging the widget: widget.oknardia.ru . It says:

<iframe seamless src="http://oknardia.ru/widget/id_2" name="oknardia" width="100%">
    Если бы ваш браузер не поддерживал iframe, тут был бы виджет!
</iframe>

And, bam! But it turned out that such a simple thing does not work. Moreover, I see in the logs that calls to /widget/id_2 pass, and the server gives all rank by rank with code 200.

Perhaps it's all about the browser's security settings, but all browsers work the same way.

For example, I inserted another one <iframe>from external sites. Some sites show, some don't. For example, an iframe that loads something from a toster is processed. It seems that something in the HTML content itself for the frame is not right. What has changed in the iframe concept in the last 15 years? What needs to be "said" in the HTML for the fema to make it work?

By the way, why is the seamless attribute not working properly? It must, among other things, ensure that "the height is generated automatically based on the content." This is not provided for a frame with loading from toster.ru. Does it even work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-05-03
@Sergei_Erjemin

The server sends a header that prohibits display in frames on a foreign domain.
X-Frame-Options: SAMEORIGIN

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question