/    Sign up×
Community /Pin to ProfileBookmark

Question on how page automatic update it self.

Hi I am new to PHP and Javascript. I want to design a site that has chat rooms. I have observed some online chat rooms like facebook chat. It seems like instant chat to me when I send a message the other side immediately receives it. The only way that I could think of to program it is by using a ajax loop to repeatedly send request to server to check updates. I do not know if this is the technology they used or is there better way to do it? I think the same thing apply to hotmail, when new mail comes in it page updates immediately without refreshing. It almost like there is a listener that listen to update request from the server.

Please help.

Many Thanks.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@toicontienJan 22.2011 — You may be interested in Strophe, which is a collection of technologies that allow you to do long polling AJAX requests, where an AJAX request remains open for several seconds allowing multiple sequences of data to come through.
Copy linkTweet thisAlerts:
@williamshen25authorJan 24.2011 — You may be interested in Strophe, which is a collection of technologies that allow you to do long polling AJAX requests, where an AJAX request remains open for several seconds allowing multiple sequences of data to come through.[/QUOTE]

Thanks, I have looked into the site and downloaded the strophejs to play with. After I run make file and tried to open up an example file called "basic.html", it asked me to input for JID and password. Can you tell me what is strophe referring to?

Thank you.
Copy linkTweet thisAlerts:
@toicontienJan 25.2011 — I honestly have no idea. You might try getting help on the mailing lists for Strophe, listed on the Strophe home page. They also linked to this blog post: http://anders.conbere.org/blog/2009/09/29/get_xmpp_-_bosh_working_with_ejabberd_firefox_and_strophe/
×

Success!

Help @williamshen25 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...