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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:48:49+00:00 2026-05-20T19:48:49+00:00

In an ajax call (for a game) that tries to pass two values in

  • 0

In an ajax call (for a game) that tries to pass two values in a dictionary, only one of the values seems to be getting read in, while the other (an instance of a JavaScript class) seems to be throwing “TypeError: Cannot read property ‘col’ of undefined.” This is despite the fact this call is built identically to other calls in the same code that work fine.

Here’s the class that seems to be causing the problem:

function Cell(col, row) {
  this.col = col;
  this.row = row;
  // as well as an .eq and .ne and one or two other simple methods
}

Here’s the setup for the call:

uCell = new Cell(-1, -1); // creates the Cell instance to pass
var dataout = {
  ucell:uCell,
  boardnumber:G.BOARDNUM,
};
// able to alert out both ucell and uCell values here just fine as well as boardnumber

And here’s the call itself:

rqst_cellboard = $.ajax({
  type:     "POST",
  data:     dataout,
  url:  "/project03/cellboardcall/", // this never gets called
  dataType:"json",
  error:    // etc.
  success:  // etc.

The error is thrown before the ajax call is made, apparently as it is being set up. Looking at the context object at a jQuery breakpoint where the error is thrown, it looks like the data value only has boardnumber in it, not ucell. The error reads TypeError: Cannot read property 'col' of undefined. I can’t figure out where in the jQuery to find what argument is undefined, but I’m assuming it’s ucell, since that’s what should have the col property.

Everything seems to be defined nicely going into the call, but the call itself is getting borked. I’m sure this is something pretty simple, but I can’t figure it. Grateful for any ideas.

  • 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-20T19:48:50+00:00Added an answer on May 20, 2026 at 7:48 pm
    rqst_cellboard = $.ajax({
      type:     "POST",
      data:     dataout,
      url:  "/project03/cellboardcall/", // this never gets called
      dataType:"json",
      error:    // etc.
      success:  // etc.
    

    I bet the problem is related to the fact “dataout” is not a properly-formatted JSON object. In particular, it has a reference to uCell, which itself is not a JSON object, since you say it has methods implemented.

    JSON objects have to follow a fairly rigid set of rules, in terms of what sorts of properties they can have. You will likely need to create a new object just for the ajax call, which only contains the properties you actually want to transfer.

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

Sidebar

Related Questions

My ajax call works only the first time. After that I get an Method
I have an ajax call that works fine in Firefox, but I am getting
I have a jQuery ajax call that returns html of a table. Now I
I have a jQuery AJAX call that I will need to do multiple times
I have an ajax call that returns JSON data (Data Attached). After converting the
I am performing a AJAX call after dismissing a Sheet. The problem is that
In my JS I have the following ajax call, that bind the resulting json
I have an ajax call that refreshes the following table. Can I have the
Im doing an ajax call, that does the following on success: success: function(data) {
If I have an AJAX call that returns, say, a CSV, how do 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.