title: Why jQuery ajax does not serialize my object?
body: <p>I am using jQuery 1.7.1. and I have the following question/problem:</p>
  
  <p>The code has as follows:</p>
  
  <pre><code>var accountObject = new Object();
  accountObject.account = new Object();
  accountObject.account.sas = [];
  
  $.ajax({
      type: "PUT",
      url: "/a/2",
      data: accountObject,
      dataType: "html",
      success: function(msg) {
          alert_user("Successfully saved the selected session attributes as defaults");
      },
      error: function(msg) {
          alert_user(msg);            
      }
  });
  </code></pre>
  
  <p>The problem is that, due to the fact that I set <code>accountObject.account.sas</code> to an empty array, the <code>data</code> arrives completely empty at the server, as:</p>
  
  <p>{}</p>
  
  <p>where it should have been:</p>
  
  <pre><code>{ "account": { "sas": [] } }
  </code></pre>
  
  <p>When I put some entries in the <code>sas</code> property of <code>account</code> then everything is ok. For example, if I put the string "1", "2" and "3" as an array <code>["1", "2", "3"]</code> then I get on the server:</p>
  
  <pre><code>{ "account": { "sas": [ "1", "2", "3" ] } }
  </code></pre>
  
  <p>Does anybody know why this is so?</p>
  
  <p>Thanks in advance
  Panayotis</p>