NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Have the page automatically reload when content changes

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 02-09-2004, 03:29 AM THREAD STARTER               #1 (permalink)
New Member
Join Date: Jan 2004
Posts: 2
lucesei is an unknown quantity at this point
 



Have the page automatically reload when content changes


Is this possible? And how?

My problem is this: I have a javascript menu on my pages. This menu is in a separate file and linked to every page in the site with the usual <script...src="some_name.js></script> in the head.
The problem is that when I modify the menu (add, remove or modify links), the old version still shows up on the page, because of the cache, and the new version only shows up when the page is reloaded.
????: NamePros.com http://www.namepros.com/programming/19967-have-page-automatically-reload-when-content.html
A nice solution would be to find a way to reload only the some_name.js file, instead of the whole page - to save on bandwidth. The standard solutions - metatags, js onload functions etc.. - reload the whole page, and reloading something like 80kb (whole page) instead of 4kb (js menu) makes quite a difference !! And another problem is that they reload the page every time it is visited

But what I would really like to find, is a way to make the browser reload the page only if the content has been changed. I've read that you can do this by setting cookies, but I haven't found any good explanation.
Ideally, I'd like to setup a system that:
- loads the page and sets a certain cookie;
- upon revisiting the page, checks for that cookie: if missing or outdated, reloads the page;
- if present, does not reload the page.

Is this or something similar possible? If the answer is yes, how do you do it? And what about the cookies...I don't know anything about actually creating them.

I don't dare to ask for a complete explanation (but it would be nice). Just if someone can direct me to a good on-topic tutorial would be fine.

Thanks for all the help you will give me.
lucesei is offline  
Old 02-17-2004, 03:05 PM   #2 (permalink)
Rob
Senior Member
 
Rob's Avatar
Join Date: Feb 2004
Location: England, UK
Posts: 2,337
Rob is a name known to allRob is a name known to allRob is a name known to allRob is a name known to allRob is a name known to allRob is a name known to allRob is a name known to allRob is a name known to all
 



Would this be like on www.hit40uk.com?

When the UK chart is announced, the page refreshes itself on a countdown when the webmaster changes the chart table.
Rob is offline  
Old 02-17-2004, 07:06 PM   #3 (permalink)
RyanPrice.ca - Developer
Join Date: Dec 2003
Posts: 1,328
Jeanco is a jewel in the roughJeanco is a jewel in the roughJeanco is a jewel in the rough
 



You could have the page auto-refresh every 30 seconds or so... not sure if that clears the cache and I find it a tad annoying but it would get the job done if it does.
__________________
Ryan Price - Webmaster
www.HostDurham.com - For Hosting | www.jeanco.ca - For Webdesign
Jeanco is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 04:02 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger