My HTML markup is pretty simple
....
<iframe width="800" height="800" src="http://localhost:69345/Handler.ashx"/>
...
but this page is blocked by all browser that I've used. I'm wondering is there any workaround for this issue? Surely, I completely understand that in case when my page will be deployed in production there will be no problems. However, how can I do any testing if iframe is blocked on local?
Thank you in advanced
Notice the iframe does not show up. However, if you change the frameset tag to div tag then the iframe will display.
The iframe tag is used to display a web page inside a web page. When you create a document to be inside an iframe, any links in that frame will automatically open in that same frame. But with the attribute on the link (the element or elements), you can specify where the links will open.
Iframes are most often used to embed specific content from one web page — like a video, form, document, or even a full web page — within a different web page. This is a powerful capability in HTML — you can take any content from any website (with permission) and place it on your own site to enhance your content.
Don't use absolute url
use relative
....
<iframe width="800" height="800" src="Handler.ashx"/>
...
When Chrome shows the following text in the iframe:
It's because the server responded with the X-Frame-Options
header to DENY
.
The solution is to change the server configuration so that it removes this header or sets it to SAMEORIGIN
.
For example, if you're using a Django, you can either change the X_FRAME_OPTIONS
setting or decorate your view with @xframe_options_sameorigin
or @xframe_options_exempt
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With