nitiphone2021 Posted May 21, 2021 Share Posted May 21, 2021 I have a chat system, admin and guest chat. on Admin. After Login I created javascript to send ajax every 5 seconds to server to update status online on guest also. My problem is admin login on chrome and they go to another software or do another work but still login to chrome. sometimes I found javascript or ajax not send to server setInterval(function () { fetch_user(); update_chat_history_data(); }, 5000); Any way I can update admin status after they login and go another software or interface Quote Link to comment https://forums.phpfreaks.com/topic/312762-javascript-sometime-not-work-when-user-not-in-chrome-interface/ Share on other sites More sharing options...
requinix Posted May 21, 2021 Share Posted May 21, 2021 Browsers may throttle background activity when users are not active on the page. Switch to WebSockets instead of AJAX polling. Quote Link to comment https://forums.phpfreaks.com/topic/312762-javascript-sometime-not-work-when-user-not-in-chrome-interface/#findComment-1586707 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.