It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

iframe + refresh

iframe + refresh

Postby lalalogic on Tue Nov 01, 2005 8:47 pm

Imagine you have a page with a menu that targets every link to be shown in the main iframe. Hmm let's say that it's a News/Games/Tuts/Info/Forum menu as above.

The news.htm is the first page to be shown in the iframe of the general page's index. Same way if we click on Games, the games.htm is shown.
But if we refresh the whole page, it shows the news.htm in the iframe again... i don't know how to explain it exactly :roll: :?

Is there a way to keep the same iframe content after refreshing the whole page? i've been googling for a while but i haven't found anything. It probably works with javascript. Has anyone done that before? It's not that important but i was wondering if there's a way it works.
bahbye devppl :]
lalalogic
100+ Club
 
Posts: 200
Joined: Tue Aug 16, 2005 4:02 am

Postby rse on Fri Aug 25, 2006 9:58 am

When you refresh, you are refreshing the full page and not the iframe, therefore the iframe will go back to the one you have put in your index.htm file in <iframe src="news.htm">.

My advice would be to not use iframes and maybe use includes or something in PHP. Alternatively, maybe you could use sessions to record the page filename you are on and set the <iframe src="<?php echo $_SESSION[page_url];?>">.

I hope this helps a little.

Adam
Adam Williams
PHP Web Developer

Personal: http://30things.net
Blog: http://www.root-servers.co.uk
User avatar
rse
100+ Club
 
Posts: 141
Joined: Sun Oct 10, 2004 8:15 pm
Location: Leeds, UK


Who is online

Users browsing this forum: No registered users and 7 guests