Any disadvantages to using iframes

I've been advised to use an iframe to share a form between 2 websites, but I always got the impression that iframes are bad or that they shouldn't be used. Not sure I even remember what gave me this impression. So can someone clarify if using an iframe is bad practice or not, and if it is bad practice, why?


If you are using PHP, it's better to put the form in it's own file, and include it.

http://php.net/manual/en/function.include.php


iFrames allow you to share a limited amount of information (client-side) across domains. Many web ads are loaded within iFrames.

iFrames are heavy elements (the iFrame is the most expensive element to add to an HTML page) so adding many will be slow but one is usually well within acceptable.


The golden rule is : Use it but Do Not Rely On It!

Iframes do not provide close integartion with the "master" content....

In addition, due ( thankls) to the "same orgin" security policy, no context must be shared between Iframes belonging to an external/different content ...

In the case of "internel Iframe" (the source of the Iframe is the same then the global site ), you need rather to rely on some mecanisms offered by the technology you are using ( ie. with PHP : use include)

For a while, some browsers were subject to some security flaws related to iframes... (injecting a hidden iframe in a "victim" site and attack the users of this site)

https://www.owasp.org/index.php/Cross_Frame_Scripting

链接地址: http://www.djcxy.com/p/3200.html

上一篇: push()相反;

下一篇: 使用iframe的任何缺点