How does one post nested JSON using JQuery?
<p>I have an admin page for a store where a user can modify item data. I'm trying to implement something for the admin to add and remove images by dragging them to and from a div. </p>

<p>I can submit the data just fine until I add the "images" object to the mix as follows:</p>

<pre><code>$("#saveButton").click(function() {
    $("form *, button").attr("disabled", "true");
    formData = $("#itemForm").formHash();
    formData["item"] = $("#itemSelector option:selected").val();
    formData["action"] = "save";
    formData["images"] = {};
    $("#otherImages img").each(function(i){
        formData["images"][i] = $(this).attr("src");
    });
    $.ajax({
        type: "POST",
        url: "adminajax.php",
        data: formData
    });
});
</code></pre>

<p>Here, the "images" value is submitted as "[object Object]".</p>

<p>I would like to have "images" be an associative array on the server.</p>

<p>One workaround is to simply have several image keys: "image1: source", "image2: source" etc, however, it would really be nice if it could be an object so that I can do a for-each on "images" instead of filtering the key strings.</p>
