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 8302335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:15:52+00:00 2026-06-08T17:15:52+00:00

I managde to post singel data with socket.io, but if i add another(timestamp) then

  • 0

I managde to post singel data with socket.io, but if i add another(timestamp) then its showing nothing.

app.js

app.post('/update', function(req, res, next){
    io.sockets.emit("update", req.body);
    io.sockets.emit("update", Date.now());
    res.send({});
});

add_users.jade

    script(src='jquery-1.7.1.js')
    script(src='http://localhost:3002/socket.io/socket.io.js')
    script(type='text/javascript')
        var socket;
        socket =  io.connect('http://localhost:3002'); 
        socket.on('update', function(newUserAdded, time) {
            console.log("update: ", newUserAdded + "update: ", time)
        });
        $(function() {
            $("button").click(function() {
                $.post("/update", {
                    newUserAdded: $("input").val(),
                    time: getTime()
                });
            });
        });
  • 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-08T17:15:53+00:00Added an answer on June 8, 2026 at 5:15 pm

    It should be (new Date).getTime()

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

Sidebar

Related Questions

I managed to post a status to my wall with a custom app, but
I'm trying to manage a bunch of socket connections. My app is basically an
i cant get the form to post the variables to another script using dynamic
Hi I am trying to add facebook connect to my Android app , I
Hi guys after the help in another post I managed to get the following
Just started with JQuery and I've managed to pass a parameter using POST, firebug
All, in this post xp_cmdshell Query Length Too Large I managed to obtain a
I need to make an web application to manage posts, when a post is
I've installed NVM for node.js using the instructions from this post: http://www.backdrifter.com/2011/02/18/using-nvm-and-npm-to-manage-node-js/ When I
I manage my websites with ISPConfig 3.0.4. This is a great tool but I

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.