Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

This may have already been asked by someone, but I can't seem to find the answer. At the risk of repeating a question, I would like for someone to explain the reason that Google's Gmail is placed inside of an iFrame HTML element instead of simply placing the code in the document itself.

If this has been asked (and answered) before, please direct me to the correct answer since my searches haven't resulted in any definitive answers. Again, sorry if this is a repeat.

Thanks.

share|improve this question

3 Answers 3

up vote 9 down vote accepted

According to the Gmail blog, an iFrame is used to host the code which handles gmail so that messages opened in new windows can be used without having to reload resources, and can persist even if the parent window is closed. See this blog post for some more details on how it works.

For the technically curious among you, our friends on the Chrome team made it possible to transfer the code that runs Gmail from one window to another as the window closes. When the window that hosts the code fires an unload event, we move the iframe with the code to a surviving window. Everything continues to run, including timers and outstanding requests.

share|improve this answer

I'm not sure myself - but my guess is that it would be because it fixes some javascript or css bugs / limitations.

share|improve this answer

Is it inside an Iframe irrespective of what browser is being used? There might be number of reasons for that, starting from a hack ( oh no god forbid ) , to having in IFrame when servicing to some specific browsers issues as Samuel Walker said in his answer.

What is the source of IFrame? It might be that there is no deeper reason for it being in the IFrame and if you use some firefox extensions you can see the document outside of the IFrame. Just try browsing the real documents location and see what changes, that might be the answer to why they are using IFrame.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.