Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are iframes a terrible idea? [closed]

I'm building a widget, and I've been using iframes to present content within it. At some point, I might start serving third party HTML and JS, so I thought iframes would be a good idea.

It does make the widget javascript a little more complicated, and I'm concerned that this might not be the best implementation.

Do you have any advice? It would be a huge help to hear what other people think about iframes.

like image 436
jamtoday Avatar asked Sep 18 '08 20:09

jamtoday


People also ask

Are iFrames a bad idea?

Iframes Bring Security Risks. If you create an iframe, your site becomes vulnerable to cross-site attacks. You may get a submittable malicious web form, phishing your users' personal data. A malicious user can run a plug-in.

Are iFrames going away?

IFrames are not obsolete, but the reasons for using them are rare. Using IFrames to serve your own content creates a "wall" around accessing the content in that area. For crawlers like Google, It's not immediately clear that cotent in an iframe will be ranked as highly as if the content were simply part of the page.

What replaced iFrames?

Use the embed Tag as an Alternative to Iframe in HTML The embed tag is similar to the object tag, and it is used for the same purpose. We can embed various external resources in our web page using the embed tag. We can embed media like PDF, image, audio, video, and web pages.


1 Answers

No, nothing wrong with iframes. Iframes are probably a better idea if you're going to start serving third party content.

The upcoming HTML5 spec also plans to build more security features into iframes for situations like this, so I would consider it good practice to use them now also.

like image 76
Zach Avatar answered Oct 13 '22 19:10

Zach