Possible Duplicate:
Are iframes considered 'bad practice'?
As far as practicality of application and what is considered “good” or “proper” practice in modern web development, is using the <iframe> tag considered “acceptable”?
I’m aware that HTML5 has implemented some new attributes for this tag, but IIRC, <iframe> has gotten some bad rep in the past.
Is this something that should be handled case-by-case, or is it best to try and avoid the usage of this tag despite HTML5s new support for it?
Yeah, this is one of those cases where it’s not a “yes or no” type answer. Nowadays there is a lot you can accomplish using AJAX to load HTML from the server and have it populate a div for you – heck jquery’s even got it built into their AJAX functions.
I normally try to figure out if that’s a good solution for the problem before resorting to iframes. Sometimes, however, an iframe just does the job better. It maintains its own browser history, helps you segregate CSS styles if that’s an issue with the content you’re loading in.
I like j08691’s comment that it’s a “necessary evil” sometimes, but don’t let that stop you from using it when the AJAX/Div solution just gets too damn ugly or requires too many hacks to get working.