| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| New Member Join Date: Jan 2004
Posts: 2
![]() | 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. |
| |
| | #2 (permalink) |
| Senior Member Join Date: Feb 2004 Location: England, UK
Posts: 2,337
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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. |
| |
| | #3 (permalink) |
| RyanPrice.ca - Developer Join Date: Dec 2003
Posts: 1,328
![]() ![]() ![]() | 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 |
| |