It seems impossible to me to realize this array structure
[{ "Field1" : "Foo"}, {"Field2" : "Bar" }]
with following code
var matching = new Array();
$('tr[type="entity"]').each(function(){
var $select = $(this).find('select');
matching[$select.attr('id')] = $select.val();
});
This
alert(JSON.stringify(matching))
returns [ ] always. If it would be php my array would look like that
$matching = array(
"Field1" => "Foo",
"Field2" => "Bar"
);
I know there is no associative array in javascript. However how can I realize such an array based on my code.