Divs Vs Dynamic Divs Vs Iframes

Don Von Alpha Dom
by Don Von Alpha Dom · 3 posts
10 years ago in Layouts
Posted 10 years ago · Author
First, lets understand the difference between dynamic and static content.

STATIC:
- Never changes; the text and images on the page always stay the same.

DYNAMIC:
- text and images on the page change when an event in triggered, such as a button being pressed causing new information to appear on the current page

Now lets review our HTML tags:

DIV:
- a div tag acts as a container for a block of content, content such as text or images. Many people call a div a box, because visually it resembles a box.

iframe:
- an iframe tag is used to load a window inside of a window. It will allows you to load any web page inside of another webpage, just like you would load an image. For instance, you could use it to load google.com in the middle of your HP. With iFrames, you can easily host your content on an external website (such as the popular webs.com).
iFrames are coded using a source file link. This link must be in .html format to work properly on most content hosts. The content of the html file will show up in your iframe box.
Links of format php may also be used, but php uses a slightly more advanced scripting syntax than HTML. Thus it is advised that beginners begin with HTML if using iframes for their layout.
iframes are considered outdated by industry standards because they technically load a second window inside of the current window, thus doubling the load on the browser for that tab. On top of that, many browsers by default block iframes that load externally hosted content, because iframes can be used for types of hacking that will not be discussed in this area of our forums. The main downside with iframes is that because they are no longer considered standard HTML, many many of the newer styling techniques involving CSS3 and filters do not work on iframes in some browsers.

Now, let's go over how a basic div, dynamic div, and an iFrame are different when used for layouts.

BASIC DIVS:
Basic divs are not dynamic, they are static.
This means that the content in each box will not change by clicking a button/link.
When using basic divs for your layout All the information you want displayed on your HP will be shown in one of the boxes created by the divs.
Also, basic divs host all of their content within the coding, not on an external site (like an iFrame could).

DYNAMIC DIVS
Dynamic divs are exactly like divs, but with changing content.
To change content, a viewer will click a tab/link.
Javascript scripting is used to detect when the viewer clicks, and then changes the content within the divs.
With a dynamic div, all the content is normally stored within the layout coding, not on an external site (just like a basic div, but dynamic).
If you really feel like you must store the content on an external site for business or security purposes, you may load the information from an external host using a javascript technique known as Ajax. Ajax loads XML data from an external source and since HTML is written in the XML format, it is perfect for grabbing and displaying externally hosted HTML within a div.

IFRAMES:
You can use iframes for static and dynamic layouts, but are most common for dynamic layouts. Many layout artists who sell their work will use this method, because it easily allows them to host the content on their own server / host where only they can edit it. Thus you must pay them for further edits. iframes are however easier to code than dynamic divs, so from an amateur standpoint, iframes may be a more viable option.

COMPARISON:
If you do not care about having dynamic content, then use basic divs.
If you know how to script well and you want dynamic content, then use dynamic divs.
If you do not know how to script well and you want dynamic content, then use iframes.
Posted 9 years ago
Wow i just learned alot from this. much appreciated Don V. so i think the best options here is Dynamic Divs with IFRAMES. thats just me though for my goals.
Posted 9 years ago
Although in the long run, using dynamic divs is the better option. Relying on iframes not only increases the load times but it adds an extra layer to your layout that can break. Remember, everything hosted on another server has to rely on that server being up and running.

Which is why I prefer to use javascript and dynamic divs. I don't have to worry about finding a free host with limited restrictions, whether the host will still be active in a couple years or having to pay for a premium host.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT