CodeIgniter Forums
CodeIgniter, refreshing view for all clients - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Choosing CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=8)
+--- Thread: CodeIgniter, refreshing view for all clients (/showthread.php?tid=84738)



CodeIgniter, refreshing view for all clients - DunogRamers - 11-04-2022

There is my problem. My project is using CodeIgniter.

I'm working on a game, during this phase, the player must choose a music. He got a form to send the URL. Other player have to wait him, and I want to refresh view for everyone when the player has sent the music.

I did first a JS function which refresh every second the page, the problem is if the player write something in the form it will refresh for him too.

Is it possible to do something like that with CodeIgniter ?

<script>
setInterval("auto_refresh_test_refresh()",1000);
function auto_refresh_test_refresh(){
        $( "#test_refresh" ).load(window.location.href + " #test_refresh" );
}
</script>
This is my JS function echatspin echatrandom with the problem.

Thanks for your help !!