{
'status': 200,
'val': '1766666',
'val1': '66K',
'val2': '1233',
'val3': '68.9',
'val4': '120',
'val5': '7.7',
'years': [{
'year': '2019',
'month': '1',
'val6': '111',
'val7': '3333',
'val8': '1212121'
}, {
'year': '2019',
'month': '2',
'val6': '134',
'val7': '5387',
'val8': '1519550'
}]
}
<script>
var response = "{{res.years|escapejs}}";
for(var i in response)
{
var x = response[i].year;
alert(x);
}
</script>
我希望所有名为“ years”的对象的值