what methods are there for automatically updating content?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
nakins
Forum Newbie
Posts: 8
Joined: Sat Oct 13, 2007 2:46 pm

what methods are there for automatically updating content?

Post by nakins »

I've been working on a way of updating page content where new information is available to a user while they are using the site/page. I'm sure you know what I'm talking about, but for clarity, I will give the stock quotes as one example, or breaking news, or message/notifier systems as others. I'm currently using a meta refresh tag along with a cookie in a hidden iFrame that runs a script that checks an "updates" table. If updates are found, the script writes some javascript code to the iFrame's document that calls for other Iframes to be reloaded. I think this is better than just reloading the whole page every XX seconds, but I wish I didn't have to run the "check for updates" script and tapping the database every XX seconds from XXX number of users either.

I'm looking to improve what I have, or find a better way. The one problem I have is that I'm in a business intranet environment, and a lot of the machines are kind of old and have minimum ram. So loading a lot of javascipt will just cripple these machines.

So, if you know of anything that might be useful in updating content, I would appreciate any direction or suggestions you might offer.

Thanks
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: what methods are there for automatically updating content?

Post by Chris Corbyn »

This lends itself perfectly to AJAX. Basically your JavaScript code can call on the server to ask for information about new events, the server responds with either JSON or XML that the JavaScript decodes and interprets. If the response shows that new content is available, have the JavaScript write this out to the page, using the DOM.

jQuery will make all of this easier to achieve :)

EDIT | By the way, this isn't "a lot" of JavaScript code. It would be extremely lightweight.
Post Reply