Search code examples
htmliframeembedded-resource

Link in iframe ok, but does not display in embedded page


I am trying to embed a map into a travel blog using an iframe. The underlying web page is fine, but it doesn't display in the iframe. I suspect it is a size problem, and I've tried adjusting various parameters. Does anyone know what I can try next?

I am able to recreate the problem under jsfiddle.

<iframe src="https://trackmytour.com/cgkvp/e" width="100%" height="300" style="border: 1px solid black;">
</iframe>


Solution

  • A quote from the console when trying to load that iframe :

    Cross-Origin request blocked: The Same-Origin-Rule forbids reading of the extern resource at https://trackmytour.com/static/vue/js/chunk-vendors.2eefddd2.js. (Reason: CORS-Header 'Access-Control-Allow-Origin' missing).

    Thats the reason that you cannot see it in the iframe. More details about that can be found here. If you are not the owner of the website and have access to the webserver, there is no way to circumvent this problem : What you are trying to do is not possible, sorry ...