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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:49:54+00:00 2026-06-02T17:49:54+00:00

I read that nowjs supports passing objects around as well as just strings, but

  • 0

I read that nowjs supports passing objects around as well as just strings, but for some reason I’m having problems with it. This is the nowjs example from their webpage with just a string getting parsed around and working fine for me,

Client Side

  now.test('foo', function(msg){
       console.log(msg);
  });

Server Side

everyone.now.test = function(val, callback){
  callback(val + ' bar!');
}

The following code I try to pass and object for the val instead,

Client Side

now.test('default', function(msg){
       console.log(Object.keys(msg));
       console.log(msg.GetEthernet());
  });

Server Side

everyone.now.test = function(val, callback){
    var profile = honeydConfig.GetProfile(val);
    console.log("Got eth " + profile.GetEthernet() + " for profile " + profileName);
    callback(profile);
}

On the server side, it prints the correct output of the GetEthernet function. On the client side it just says, “Uncaught TypeError: Object # has no method ‘GetEthernet'” and returns an empty array for Object.keys”.

  • 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-02T17:49:56+00:00Added an answer on June 2, 2026 at 5:49 pm

    I haven’t used nowjs, but I’d be very surprised if it could send full JavaScript objects between server and client – that is, objects with a prototype chain and methods. No matter what framework you’re using, objects passed between client and server will need to be serialized as strings; in the case of JavaScript, this usually means JSON serialization. If the nowjs docs say you can pass an object, they probably mean a plain JavaScript object, one that’s JSON-serializable. Otherwise, you’d have to serialize object methods and send them to be re-interpreted by the client, which wouldn’t make any sense for all but the most trivial methods.

    Long story short, try passing the output of profile.GetEthernet(), rather than passing profile and calling the method. If you need to pass more data about profile, you can create an object with various method outputs and send that.

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

Sidebar

Related Questions

I read that some versions of IE6 have known issues with gzip compression, but
I read that some webmail services prefetch url links in emails. The GET request
I read that early builds of Chrome supported ActiveX, but was later restricted to
I read that Python does not actually support 2D arrays but rather an array
I read that great post on Visual Studio 2008 annoyances, but didn't see this
I read that Vectors are not seqs, but Lists are. I'm not sure what
I read that Rails follows some naming conventions, model name should be singular and
I read that you should define your JavaScript functions in the <head> tag, but
I read that before 3.0 data like bitmaps is strored outside the heap. But
I read that the ^ operator is the logical XOR operator in C#, but

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.