Sto utilizzando funzione JQuery map per ottenere una matrice di valori ingressi:Come ottenere array associativi come output da jQuery.map?
var inputs = $("[id^='field']");
var values = inputs.map(function() {
return $(this).val();
}).get();
desidero ottenere un array associativo [id, valore]:
{
id1: value1,
id2: value2
}
Questo creerà un array di oggetti. Presumo che voglia solo ottenere un oggetto. –
@FelixKling: Penso che tu abbia ragione. Aggiornerò a meno che qualcun altro non mi picchi. ;) – RightSaidFred
@RightSaidFred: Ya, Felix ha ragione, voglio un oggetto, non una matrice di oggetti. – Homam