Welcome Guest, Not a member yet? Register   Sign In
When the database changes, the page will reload..
#1

[eluser]magz[/eluser]
Hi all,

Is there any way or technology that can do as it is said in the title (When the database changes, the page will update) ?. We build a simple chat application using ajax. But it cause traffic due to alot of request to the server.

So we come up with that idea.. if there are updates, insert or delete happens in the database the page will just update automatically without repeatedly requesting to server..

is there any way we can achieve that idea??..

Any help will be appreciated..
thnx..
#2

[eluser]xwero[/eluser]
i guess for chats comet is the way to go.
#3

[eluser]magz[/eluser]
xwero, thnx for the response..

What is chat comet??
#4

[eluser]Mark van der Walle[/eluser]
You would have to use some polling technique (with AJAX). Like every x seconds ask the server: Hey are there updates since timestamp y. If so so reload the page. A chat app using HTTP always would generate alot of requests.
#5

[eluser]magz[/eluser]
Mark van der Walle, thnx for the response..

Can you post some sample code?.. Actually Im just new to ajax..
#6

[eluser]xwero[/eluser]
wikipedia comet
#7

[eluser]Mark van der Walle[/eluser]
I could come up with some code. But perhaps its better if you learned about Ajax yourself. Google is your friend:

Also:
http://www.w3schools.com/Ajax/Default.Asp
#8

[eluser]magz[/eluser]
Wow, lot of works to do with this.. hehe :lol: huhu :bug:

Anyway, thanx alot guys..




Theme © iAndrew 2016 - Forum software by © MyBB