A few months ago, I took over the Corvid by Wix StackOverflow tag to help answer questions about Corvid (formerly Wix Code). One of the common themes I saw popping up was people loveee using iFrames on their Wix sites. And for a second I thought maybe 2020 is all a dream and I'm actually back in 2008. But then I pinch myself, and it hurts so I'm awake and it really is 2020.
To figure out why people are still using iFrames, I went to the one place I find all my information...Google Search. The main themes I found there were people are using iFrames to:
- not have to deal with CORS and giving 3rd party sites/services unrestricted access
- it's easier to pull UI elements across with iFrames
- Advertising and Marketing
- maybe the 3rd party you are working with doesn't provide an alternate solution
But using iFrames does cause problems for developers. iFrames are one way, so there is no way to get responses from any embedded forms. This makes it harder for the ever-growing-in-popularity event driven programming. Additionally when we all have 3 different screen sizes in our pockets/bags/homes, iFrames aren't inherently responsive and can break the user experience on a mobile site. And from an SEO perspective, they may not help you as the content cannot always be indexed.
So in today's modern world of REST APIs and GraphQL, why are you still using iFrames? I am hoping to start a series exploring this topic, so please share you positive or negative iFrame experiences in the comments!