Iterating through inputs and passing data to an AJAX function
<p>I am looping through several inputs and trying to append that data into an object which I can then pass into an AJAX function.  I'm not quite sure what I'm doing wrong, but I keep getting an error that says <code>"Uncaught SyntaxError: Unexpected token )"</code>, and I can't find this extra bracket, and I think I must just be doing this incorrectly.</p>

<pre><code>var dataObject = [];

$("#"buttonId).find("input").each(function(index) {

    inputId = $(this).attr("id").replace(buttonId, "");
    inputValue = $(this).val();

    var data = { 
       inputId : inputValue;
    }

    dataObject.push(data);
});

$.post(
    'ajax/' + buttonId + '.php', 
    {
        dataObject: dataObject
    },
    function (response) {
    }
);
</code></pre>
