Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3334154
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:52:26+00:00 2026-05-17T23:52:26+00:00

I have a chat feature on my website that I want to replicate the

  • 0

I have a chat feature on my website that I want to replicate the facebook functionality of blinking “new message from John” in the title tag when a new message comes in. I can do this for one instance of a new message however I need to do this for all new messages (infinite possibility). Therefore a setInterval loop needs to be created and cycle through the names of people who have sent a new message. Lets assume John, Sue, George, and Katy have sent me new messages; this is what I have so far:

 $("div .labels").each(function(){   //.labels where each persons name is displayed in the bottom banner bar
  var senderFirstName = $(this).attr('rel');
  //this is where I need to create the array "AllNames" containing all of the sender names
 });

Now that I have the array “AllNames” containing all the first names of people sending me messages, I need to cycle through this array every 1500ms and change the title tag to reflect the new name.

 var BlinkTitle = setInterval(function(){
     $("title").text("message from " + AllNames[0]); //AllNames array needs to cycle through the array values every time the interval loops.
 },1500);

Please Help!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:52:27+00:00Added an answer on May 17, 2026 at 11:52 pm

    Just increment an index:

    var AllNames = ['Me', 'Myself', 'Irene'];
    
    var ix = 0;
    
    var BlinkTitle = setInterval(function(){
        if (++ix >= AllNames.length) ix = 0;
    
        $("title").text("message from " + AllNames[ix]); //AllNames array needs to cycle through the array values every time the interval loops.
    },1500);
    

    Checking against AllNames.length will prevent you from accessing past the end of AllNames.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so I have a chat feature on my website that I've mentioned in
I have a chat program that displays I list of online users. The message
I'm maintaining some code that I want to add a chat feature to. I
I have a chat application(Socket Programming) , for that consider I have 2 separate
i have a simple chat application in flex 3 and i want to make
I currently have a basic chat program in c++ that uses WinSock2.h with UDP.
I have problem with session in cakephp.I have one file chat.php that is in
I have a tab widget where one of the tabs is a chat-type feature.
I want to implement chat feature in my android application,in this feature one user
I have created a simple chat server that is driven by client polling. Clients

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.