Hi all,
I want to create a little social network (a little test).
How can i implements period ajax call like Facebook ?
I need to update news, status,...
How does it Facebook ?
views:
257answers:
2
+1
A:
You can use setTimeOut and setInterval in javascript to time ajax calls.
EDIT:
If there are no changes you can use a larger time before for the next interval. This is sometimes called Exponential Backoff.
Paul Whelan
2010-06-18 15:16:30
I know this solution, but is it the only way ?Because if there are no changes i got overhead, no ?
enfix
2010-06-18 15:19:15
Why don't you try some AjAX framework which will handle all background complexity. May be DWR
VinAy
2010-06-18 15:36:21
A:
A technique called "Comet push", which can perform real-time server information push, may suit your need. As far as I know, it can be implemented in Ruby(Dojo) and ASP.NET (handlers). The "chat" function of Facebook uses Comet-like architecture.
ZEAXIF
2010-06-18 15:27:08