0

我有问题:我的 jquery 代码是

var sverimas_array = [];
$('table[id=aktEditTable] tbody tr').each(function(){
  var data = [];
  $(this).find('td').each(function(col_key){
    var td_input = $(this).find('div input');
    if ( col_key != 8 ) { data[td_input.attr('name')] = td_input.val() }
  });
  sverimas_array.push(data);
});
console.log(sverimas_array);
$.ajax({
  url     :"_aktas_function.php",
  type    :'POST',
  dataType:'JSON',
  cache   :false,
  data    :{job :'insert',
          PHPSESSID :'<?php echo session_id();?>',
              data  :$("#aktForm_data").val(),
          sverimas  :sverimas_array,
            },
  error   : function(xhr, errorString, exception) { alert ('error');    },
  success : function(data){
              if (data[0].status == "ok"){
                alert(data[0].st);
              }
              else { alert ('error'); }
            }
});

在控制台中,我看到 sverimas_array 如下:

[Array[0], Array[0], each: function, eachSlice: function, all: function, any: function, collect: function…]
0: Array[0]
aktForm_bruto: "55"
aktForm_indexas: "1"
aktForm_neto: "47.50"
aktForm_pakuote_skaicius: "5"
aktForm_pakuote_svoris: "9.50"
aktForm_pastaba: ""
aktForm_tara_svoris: "1.5"
aktForm_tara_tipas: "poperine"
length: 0
__proto__: Array[0]
1: Array[0]
aktForm_bruto: "55"
aktForm_indexas: "2"
aktForm_neto: "47.50"
aktForm_pakuote_skaicius: "5"
aktForm_pakuote_svoris: "9.50"
aktForm_pastaba: ""
aktForm_tara_svoris: "1.5"
aktForm_tara_tipas: "poperine"
length: 0
__proto__: Array[0]
length: 2
__proto__: Array[0]

$_POST['sverimas']_aktas_function.php文件中给我什么。

4

0 回答 0