Chat Question

I used the Sitepoint AJAX/jQuery examples at Easy Ajax with jQuery Article » SitePoint and built my own chat application to run on my server. I have everything working and running fine but have one small problem to resolve.

I’m hoping to use this as a helpdesk supplement so when chatting, one of the clients may minimize, or blur, their chat window to perform a task requested of them. Now what I’m looking for is a method to notify the “blurred” user that a new message has been posted for them to look at. I tried changing the title of the document that’s shown in the task bar but for some reason couldn’t isolate the “blurred” client only; all clients changed. I also tried window.setfocus() but that gets really annoying to users when they are forced into a window when they’re not ready. I just need something to let them know there’s a new message. Any suggestions are welcome. Thanks in advance.

To identify a certain client by username, you need to pass client username with the queries to server (could do this easily in the url with link+‘?username=’+username and retrieve on server with $_GET[‘username’] ) .

I already have all of that handled. My new code can handle multiple chats between multiple users, etc.

The last real issue I have is notification to a user that a new message has been sent to them if the window containing the chat is not in focus; they are on another tab in the active browser, they have a separate browser open and in focus, etc.

About the only useful notification technique that I’ve come across is where the task bar for the window flashes to let you know that an update has occurred to that window.

Correct, that’s the sort of thing I’m trying to accomplish but haven’t found a solid way of doing that. I’m looking for ideas on how to make that happen.

Showing an alert will cause the taskbar for that window to flash.

An alternative technique that gmail uses is to update the window title to show the number of unread/unseen messages that are waiting for the person.