• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

All About iFrames?


While I'm not new to developing websites, I've never had the opportunity to use iframes ... until now.  In addition, I believe I'll be using iframes in conjunction with a web service, but not positive.

So basically: what are iframes and how does one use them (i.e. what are the most common applications of iframes)?  

I know what I've seen of the code for them, but I would like to get some feedback from someone who has used them extensively to get a better sense of how they work and how to implement them.  URLs to a solid web tutorial on the subject are also welcome :)

2 Solutions
iframes use when you need to display 2 or more pages in a browser at the same time. for example you have a web page with chat box at the sidebar. the chat box may use iframe. for example look at my site http://jokonurjadi.blogspot.com/ (at the right sidebar there is a widget called shoutmix, it's iframe example.
iframes become most useful when a frequently external data needs to be loaded within another page.
Another necessity is when you need to display external data that does not reside on the same domain due to the Ajax cross-domain security measures.

An example would be on a page like here "www.yourcoast.verygoldcoast.com.au/offers/" , where each When you click "Get this eVoucher" it opens a lightbox with the specific offer details and a form, the offers are dynamic and instead of loading all the instances of the forms and offer details for each of these buttons which would dramatically increase the loading time and size of the main page, they are being served through an external url & querystrings for the specific offer within an iframe.

This also allows updating the form, data etc.. without needing to interfere with the main page or content.

Another example using the same technique can be found here "www.noosasprings.com.au/fitness/fitness-class-schedule/" where clicking the class loads an external page with the relevant ID.

This is only one of the situations where the use of an iFrame can be effective and enhances the user experience and overall performance but the real life applications are endless.

I hope this was helpful
max7Author Commented:
>>>An example would be on a page like here "www.yourcoast.verygoldcoast.com.au/offers/" ,

So in this instance, lightbox loads with content within an iframe dynamically generated ... is this done programatically using javascript to the make the call to the server for the content and place it within the iframe? Also, where does the mark up for the iframe reside before it appears on the page?

I noticed that the iframe in both website example you provided appear within div#mbImage ... are these sites using some sort of widget for this?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now