Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if browser support iframe?

Is there any way to detect if browser supports iframe?

like image 228
bhups Avatar asked Apr 21 '11 04:04

bhups


People also ask

Do all browsers support iframe?

An iframe is an element of HTML code. It is supported by all major web browsers and is included in the latest HTML5 specifications. When the web browser encounters an iframe element, it creates a new HTML document environment to load the content within.

How do I know if my iframe is working?

Comparing the object's location with the window object's parent location: Here, we simply compare the object's location with the window object's parent location. If the result is true, then the webpage is in an iFrame. If it is false, then it is not in an iFrame.

Do browsers block iFrames?

Yes, iFrame is supported by all modern desktop and mobile browsers but not all of them are able to respond to the new attributes from HTML5. So, the best browsers that work with iFrame are the ones that updated their HTML5 compatibility and its new elements.


1 Answers

Maybe this would work?

HTML:

<iframe ...>
  <script type="text/javascript">var iFramesSupported = false;</script>
</iframe>
like image 75
Blender Avatar answered Sep 28 '22 09:09

Blender