Submitting a Javascript object to PHP
<p>Dear fellow developers,<br />
A newbie question from me, please.</p>

<p>I have a large data set that I <strong>prefer</strong> to be submitted as an object instead of an array; e.g.</p>

<pre><code>foo = bar = baz = {};
$.ajax({
    url: "index",
    type: "post",
    data: { foo: foo, bar: bar, baz: baz },
    dataType: "json"
});
</code></pre>

<p>Upon submit, Firebug tells me that I have submitted:</p>

<pre><code>bar [object Object]
baz [object Object]
foo [object Object]
</code></pre>

<p>What I want is to be able to access the contents of foo, bar, baz (contrived example, of course).</p>

<p>Is this possible in Javascript? Or do I need to use arrays, which I do not prefer?  </p>
