reutorah Posted October 10, 2015 Share Posted October 10, 2015 Hi, i have developed a php/jquery/mysql/ajax chat script and you can see latest version at http://www.phpsunchat.com/upgrade/ now if you visit above url from 2 tabs or 3 tabs of same browser or different browser and send a message in chat room on other tab it doesnt receive or show message, what can be the reason ? Is it because of ajax ? I can provide source code to expert who is willing to help me. Thanks, Reu. Quote Link to comment https://forums.phpfreaks.com/topic/298519-is-it-because-of-ajax-sending-messages-not-receiving-in-different-tabs-of-browser/ Share on other sites More sharing options...
scootstah Posted October 10, 2015 Share Posted October 10, 2015 You should look at the responses in the other tabs when you send a message. Is the server sending anything? But you're going all about this the wrong way. Don't use AJAX for real-time applications. You're making like 3-4 HTTP requests at least every second. You're basically DDoS'ing your own server. You should use WebSockets instead, which creates a persistent TCP connection between the client and server. Whenever one person creates a chat message the server will push it out to all of the connected clients. This is a much more efficient approach, and this is the way that every client/server chat system works. Quote Link to comment https://forums.phpfreaks.com/topic/298519-is-it-because-of-ajax-sending-messages-not-receiving-in-different-tabs-of-browser/#findComment-1522892 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.