Jump to content

is it because of ajax sending messages not receiving in different tabs of browser


Recommended Posts

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.