Reply
Open page in div/iframe
Old 06-05-2007, 06:59 PM Open page in div/iframe
Novice Talker

Posts: 10
Name: mark
i am having trouble with a site i'm working on. i pretty much just got into web design, but i am picking things up fast. my problem is this: my layout is a header with a menu, i want to be able to click a link on the menu and have it not reload the entire page, but just whatever is under the menu (or any part of the page, i.e. click something and have it only have to load one part of the page).
i am currently doing this using javascript and iframes from a site that i found, however i have looked at source from other sites that do not implement any javascript, not to mention it just seems to simple to have to use script. any help would be great. also, if its not an html matter, do i need to learn php or something?
mmecca is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 06-05-2007, 07:44 PM Re: Open page in div/iframe
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
Wireless Audio
Posts: 2,322
Name: Keith Marshall
Location: West Hartford, CT
There really is no big deal in letting the page reload with new content as you are not saving load time or bandwidth in doing so.

Frames would make the top menu in a static location, and iFrames would not allow the height to adjust to longer vs. shorter content. If you do use one of these methods, just give you frame a name attribute and then specify the link to the target.

<a href="..." target="main_frame">New Page Link</a>
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 06-06-2007, 12:13 AM Re: Open page in div/iframe
Novice Talker

Posts: 10
Name: mark
i've looked at frames and i don't really like them that much. from what i can tell from most professional websites, they dont reload the whole page everytime, they do it as i described. is there no simple way to do this?

edit: more info - the external loading works fine, my problem is this: i have an index. this index has links and i want them to appear in a certain <div> but only having to load the external content into the <div> without reloading the entire page. i can load content into it, however it is not translating correctly. i.e. i have loaded another page into this div, and this page has more divs in it and they are not displaying correctly.

Last edited by mmecca : 06-06-2007 at 11:03 AM.
mmecca is offline
Reply With Quote
View Public Profile
 
Old 06-06-2007, 03:10 PM Re: Open page in div/iframe
LadynRed's Avatar
Super Moderator

Posts: 6,559
Location: Tennessee
Ok, so WHY are you concerned with not 'reloading' the page ?

As mgraphic said, you're not saving bandwidth at all, and if that is what you think you're after, then you misunderstand how http and the browser works.

The first time you land on a site, the pages, including all images and content, get 'saved' into the browser cache. If you go to a different page the ONLY things that get pulled from the SERVER are those graphics or other things that are different from the original page, these too are cached.

On subsequent visits to that site, the browser pulls from it's cache first, unless a user has cleared their cache in between visits.

If you just want maintain a single menu file, then server-side includes are the better alternative.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-06-2007, 09:38 PM Re: Open page in div/iframe
Novice Talker

Posts: 10
Name: mark
in response to the 'why' question, it is what the owner wants. he doesn't want the "white flash" everytime you click a link.
i have kindof looked at server-side includes, but know just about nothing about php/asp.
i have looked at simple menu tutorials involving php, but am unable to execute them with notepad/browser even when the code is copy/pasted. (i dont know what kind of environment i need to be in, i assume its like html and i just save it as .php)
mmecca is offline
Reply With Quote
View Public Profile
 
Old 06-06-2007, 10:37 PM Re: Open page in div/iframe
Experienced Talker

Posts: 31
Even if you get it working you won't save bandwith. Not all browsers will work. I think you should just use seperate pages.
tjtravis is offline
Reply With Quote
View Public Profile
 
Old 06-07-2007, 10:09 AM Re: Open page in div/iframe
LadynRed's Avatar
Super Moderator

Posts: 6,559
Location: Tennessee
Well, you might try explaining to your client that instead of the 'white flash' of separate pages, you'll get longer load times with frames/iframes. Rather than loading a single page, you're loading 2 - the page that holds the frame, and the page IN the frame. Add to that the fact that the iframe content cannot be bookmarked and may not get picked up by search engines, and then you have a search engine visibility problem.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Open page in div/iframe
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14310 seconds with 12 queries