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

  • Home
  • SEARCH
  • 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 8473905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:28:57+00:00 2026-06-10T17:28:57+00:00

i`m new in node js. I make chat for browser game using node js

  • 0

i`m new in node js.

I make chat for browser game using node js and socket.io. After some days of learning and coding chat works fine, but i get on problem – client browsers hangs after more client actions.

For example: client click “add” button to add text to the chat many times, and after every time he click it, browser hangs more and more, but after page refresh, all works great, till he click again “add” button many times.

And this problem appears not only on “add” button, but when client change chat (show only private or public chat) many times too.

I don`t think that problem is in server code, because, when browser hangs for me, for other clients chat works fine.
So i think problem is on client side. There I use socket.io with default settings.

Maybe someone get same problem and know how to fix it?

<script src="sockets/socket.io.min.js"></script>
<script>
var socket = io.connect('http://'+chatSocketAddress+':'+chatSocketPort);
function ANgetChatRecords(){
  socket.emit('getRecords', { my_id:my_id, type:chat_pub_chatShow, my_perm:my_perm, lang:my_lang });
  socket.on('getRecordsAnswer', function (data) {
    document.getElementById("chatbox_pub_entry").innerHTML = data.text; 
  });
} //and ther other similar functions, like add record, delete record ... 
</script>
  • 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-06-10T17:28:59+00:00Added an answer on June 10, 2026 at 5:28 pm

    I was just saying that you could be setting more socket.on() even if not explicitly.
    The code you have there seems clean but maybe you’re adding more to the same event and stacking them.
    Add some console logs so you can see how many times they are actually called.

    my code looks like this:

     listenForMessage: function(){
            param_socket.on("new", function (data) {
                    console.log('new');
                    console.log(data);
                    app.newHandler(data);
                });
    
            param_socket.on("done", function (data) {
                    console.log('done');
                    app.doneHandler(data.id,data.success)
                });
    
            param_socket.on("change", function (data) {
                    console.log('change');
                    app.changeHandler(data.id,data.success)
                }); 
    
        },
    

    One more thing, are you calling this function only once? Because you are setting up the event.

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

Sidebar

Related Questions

Lets say that i make a websocket server chat (node.js + socket.io). How would
I want to create new node of BeanTreeView, and when I add some node
I'm brand new to node.js, but I wanted to play around with some basic
I am new to node, npm, socket.io. Found many guides that are fairly useful,
I'm trying to make a simple custom field field_book_year for the new node type
My problem: My delete node method works fine for deleting any specified node from
I have this code: $node = new Node(); Now I want to make the
I'm new to node.js world, I'm using node.js v0.8.4. I googled for this issue.
I have a TreeView control, and after a new node is added, I need
When I tried to add a new node to current replica set, the current

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.