Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

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

Posts: 10
Name: mark
Trades: 0
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
 
 
Register now for full access!
Old 06-05-2007, 07:44 PM Re: Open page in div/iframe
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
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
Trades: 0
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
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

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
Trades: 0
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
Trades: 0
Even if you get it working you won't save bandwith. Not all browsers will work. I think you should just use seperate pages.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
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
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 11-15-2008, 08:17 AM Re: Open page in div/iframe
Junior Talker

Posts: 1
Trades: 0
Hey there, i have the same problem. i would like to open my links in <DIV> how can i set that up? HELP PLEASE, thank you
galexandr is offline
Reply With Quote
View Public Profile
 
Old 11-21-2008, 04:19 AM Re: Open page in div/iframe
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
The solution isnt hard just put an iframe where you want te page to open.

<iframe src="home.php" width="100%" frameborder="0" name="mainframe" id="mainframe"><iframe>

This iframe wil start with home.php when you first come to the site.
frameborder="0" this is similar to the border function in a table.

if you want the page to maintain the same height. You should put in a height.
note: height="100%" wont make the frame 100% screen height, but it will make the iframe just as high as the source page.

if you want a link to open in the mainframe, for instance an contact link.

<a href="contact.html" target="mainframe">&nbsp Contact</a>

I hope you get it

good luck
elcosmo is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Open page in div/iframe
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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 1.98616 seconds with 12 queries