I am trying to send an array using onclick in a function, for that I use json. But it marks me a syntax error when I send it.
By the way, once I get the json, how can I go through his data? Greetings.
Code:
<td>
<select id="OBJ<?php echo $idCriterio;?>" name="COE" onchange="FunSumT(<?php echo json_encode($criterio); ?> )">
<option value='0'>0</option>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
</select>
</td>
Code of my function js
function FunSumT(criterio){
var array=JSON.stringify(criterio);
console.log(array);
}