title: Confusing TypeError: Cannot read property 'n' of undefined
body: <p>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.</p>
  
  <p>Here's the class that seems to be causing the problem:</p>
  
  <pre><code>function Cell(col, row) {
    this.col = col;
    this.row = row;
    // as well as an .eq and .ne and one or two other simple methods
  }
  </code></pre>
  
  <p>Here's the setup for the call:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>And here's the call itself:</p>
  
  <pre><code>rqst_cellboard = $.ajax({
    type:     "POST",
    data:     dataout,
    url:  "/project03/cellboardcall/", // this never gets called
    dataType:"json",
    error:    // etc.
    success:  // etc.
  </code></pre>
  
  <p>The error is thrown before the ajax call is made, apparently as it is being set up. Looking at the <code>context</code> object at a jQuery breakpoint where the error is thrown, it looks like the <code>data</code> value only has <code>boardnumber</code> in it, not <code>ucell</code>. The error reads <code>TypeError: Cannot read property 'col' of undefined</code>. I can't figure out where in the jQuery to find what argument is undefined, but I'm assuming it's <code>ucell</code>, since that's what should have the <code>col</code> property.</p>
  
  <p>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.</p>