SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Chat Question

  1. #1
    SitePoint Member
    Join Date
    May 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  2. #2
    SitePoint Enthusiast VideoWhisper's Avatar
    Join Date
    Dec 2008
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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'] ) .

  3. #3
    SitePoint Member
    Join Date
    May 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by sjm133 View Post
    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.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Member
    Join Date
    May 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by sjm133 View Post
    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.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •