Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh page only if content changes

Status
Not open for further replies.

brianbek

Technical User
Jun 17, 2005
13
0
0
CA
I'm quite new to javascript, but is it possible for my page to refresh only if it's content has changed? There are a few large pictures on the page and I don't want to refresh if there is no need.
 
yes and no.

no, not purely with javascript to my knowledge.
yes, using javascript and some server-side logic, e.g.:

use javascript to send a remote scripting/ajax call to the server, which would return the date modified or version id of the page in question. then if that date modified/id is newer than the currently loaded page, use javascript to reload the page.



-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
jemminger is right: since the content is changing on the SERVER, the client (your page) will have to somehow communicate with the server to determine when it needs to be reloaded. The ajax call is certainly well-suited to the task.

There are other ways (i.e. RSS and "push" technology) that might also meet the requirements.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top