如何使用 打印网页中的对象数组元素值document.write
?
<!DOCTYPE html> <html> <body>
<script>
var data = [
{
"metadata" : {
"names":["times","values","types"],
"types":["time","linear","ordinal"]
},
"data": [
["1141237500000",4.216,"Global_active_power"],
["1141237560000",2.4130,"Global_active_power"],
["1141237620000",3.4230,"Global_active_power"],
["1141237680000",2.4560,"Global_active_power"],
["1141237500000",2.37130,"Voltage"],
["1141237560000",2.35840,"Voltage"],
["1141237620000",0.32690,"Voltage"],
["1141237680000",10.30980,"Voltage"],
["1141237500000",13.800,"Global_intensity"],
["1141237560000",16.400,"Global_intensity"],
["1141237620000",25.400,"Global_intensity"],
["1141237680000",13.800,"Global_intensity"],
],
}
];
document.write( data["data"] );
</script> </body> </html>