| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
includes vs iframe ??
hi all
I use alot of Iframes, advantages are you never have to reload your header and navigation coz i just have the content open up in the iframe, now i know the disadvantage is that when a page is searched and opened up it won't be in the iframe making it look like a lost page now i hear everyone talking about using includes for headers, navigation and footer, now as far as i understand the advantage of this is that it looks like a framed page, you only have to update one page to change the header throughout the site, like a framed site, but every time you click on a link the whole page (headers, nav, footer) has to load again right? so which one is better? |
|
#2
|
||||
|
||||
|
It depends, really. iframes can display another website's information, something include's can't. If you are passing information from the include, you can only do that with an include, not an iframe.
Yes, an include has to be loaded on each page, but it gets cached and loads extremely fast after a while. The main advantage for iframes is that you can use them in just plain HTML code, includes must be used in server side code. My suggestion: If you have server side code available, use includes. If not, use iframes.
__________________
www.xoise.com - www.ourfreegames.com - www.playg1games.com - www.randomtools.net - www.xenocide-rpg.com |
|
#3
|
||||
|
||||
|
BBD: Actually, some server software, such as PHP, does allow you to import HTML from external sources.
|
|
#4
|
|||
|
|||
|
Another advantage for includes is that elements in the included file can be easily accessible using javascript on the page. You may not need this if you only use includes in a header, but in general , includes are better.
|
|
#5
|
||||
|
||||
|
If you want to be both pedantic and semantic about things, the <iframe> element is actually intended for stuff like shoutboxes, rather than actually "importing page elements".
Of course, the whole "frames" thing is depreciated, you shouldn't use them unless strictly necessary. |
|
#6
|
||||
|
||||
|
Quote:
In light of the deprecation of frames, what would be the alternative (practical) solution for importing external content into a web page? |
|
#7
|
||||
|
||||
|
Server-side, of course.
And if you want content to stay at the same position on the page as you scroll, use position: fixed; (or Javascript for IE < 7) If you want a scrollable box on your website, give a box a width and height and set overflow: auto; |
![]() |
| Viewing: ASP Free Forums > Web Design > Web Layout > includes vs iframe ?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|