0
Как выполнить итерацию через возврат JSON через jQuery и вернуть индекс каждого объекта?Как перебирать из многомерного массива json
Примеры некоторых из моего кода ниже:
foreach (x = somevalue ; x < length of array ; x +++
{
that x must be the index
[0] => Array
$('#actual_'+x).text(data.actual+" hrs.");
$('#total_'+x).text(data.total+" hrs.");
$('#regular_'+x).text(data.regular+" hrs.");
}
(
[0] => Array
(
[actual] => 9
[total] => 10
[regular] => 0
[over] => 11
[total_h] => 11
[eng_pay] => 148.5
[rate] => 9
)
[1] => Array
(
[actual] => -1
[total] => 0
[regular] => -1
[over] => 2
[total_h] => 1
[eng_pay] => 18
[rate] => 9
)
)
Я хотел бы перебирать функции успеха этого JQuery Ajax виджета:
$.ajax({
type:'POST',
url: 'cal_grid.php',
dataType: 'json',
cache: false,
data:$('#grid_frm').serialize(),
success: function(data)
{
alert(data);
} // response call back ends
});//ajax call ends
'var x; (x = 0; x
DaveRandom
извините за это ... –