We have some pretty old, clunky .Net 1.1 apps in our business that - rather than
ID: 649463 • Letter: W
Question
We have some pretty old, clunky .Net 1.1 apps in our business that - rather than be forcably upgraded - just get an iFrame added so that new functions can be dropped in.
It's become such a well-known option that many management staff who don't really have a great deal of technical knowledge or experience suggest just throwing an iframe on a page as if that would be the only way to solve the problem.
I don't have an issue with the iframe element per se if it's absolutely necessary, but it does seem that it's a very convenient tool for something that might be better achieved with a little more thought and consideration for design.
Are iframes the web design equivalent of a code smell?
Explanation / Answer
Yes and no.
Yes they are a smell if your using them to sand box your JavaScript. Yes there a code smell if your sand boxing your CSS. You should go and reduce the damage as much as possible and not use an iframe to cheat here.
However an iframe as mentioned can be used as a poor-man's ajax.
So for the below techniques, No it would not be a smell.
Some valid techniques include posting an <input type="file"> to the server without refreshing the page (just submitting the iframe).
Another use would be using an iframe to do some kind of Comet interaction. It can be used to Stream data.
Basically ask yourself whether an iframe is used for content or functionality.
Content is bad, functionality is good. (Especially if that functionality is legacy browser support. You don't need iframes in modern browsers)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.