![]() |
When the database changes, the page will reload.. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: When the database changes, the page will reload.. (/showthread.php?tid=11470) |
When the database changes, the page will reload.. - El Forum - 09-10-2008 [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.. When the database changes, the page will reload.. - El Forum - 09-10-2008 [eluser]xwero[/eluser] i guess for chats comet is the way to go. When the database changes, the page will reload.. - El Forum - 09-10-2008 [eluser]magz[/eluser] xwero, thnx for the response.. What is chat comet?? When the database changes, the page will reload.. - El Forum - 09-10-2008 [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. When the database changes, the page will reload.. - El Forum - 09-10-2008 [eluser]magz[/eluser] Mark van der Walle, thnx for the response.. Can you post some sample code?.. Actually Im just new to ajax.. When the database changes, the page will reload.. - El Forum - 09-10-2008 [eluser]xwero[/eluser] wikipedia comet When the database changes, the page will reload.. - El Forum - 09-10-2008 [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 When the database changes, the page will reload.. - El Forum - 09-10-2008 [eluser]magz[/eluser] Wow, lot of works to do with this.. hehe :lol: huhu :bug: Anyway, thanx alot guys.. |