简体   繁体   English

未捕获的TypeError:无法读取未定义的属性“时间戳”

[英]Uncaught TypeError: Cannot read property 'timestamp' of undefined

I am new to hightcharts, I have an error which I found it on chrome console. 我不熟悉hightcharts,我在chrome控制台上发现了一个错误。 And the error is "Uncaught TypeError: Cannot read property 'timestamp' of undefined". 并且错误是“未捕获的TypeError:无法读取未定义的属性'timestamp'”。 Below is my code: 下面是我的代码:

Javascript.JS: Javascript.JS:

if(selVal==str2[j]) {
    console.log("FOLDERNAME"+selVal);
    str3.push(str2[j+1]);
}

var json = str3[0];

**//This is for highcharts where I am trying to load myjson that is present in "var json"**
for (var k = 0; k < json.length; k++) {
    jsonArray.push({
    name: json[k].map.timestamp,**//Getting error over here**
    y:json[k].map.count
});

JSON FORMAT: JSON格式:

[{"map":{"timestamp":"2016-01-09 05:55:42.0","count":367}}]

Somebody please help me out in solving this. 有人请帮我解决这个问题。 I almost tried everything. 我几乎尝试了一切。

Try this 尝试这个

 var json=[{"map":{"timestamp":"2016-01-09 05:55:42.0","count":367}}]; /***This is for highcharts where I am trying to load myjson that is present in "var json"**/ var jsonArray=[]; for (var k = 0; k < json.length; k++) { jsonArray.push({ name: json[k]["map"].timestamp, y:json[k]["map"].count }); } console.log(jsonArray) 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决“未捕获的TypeError:无法读取未定义的属性&#39;Timestamp&#39;”? - How to fix “Uncaught TypeError: Cannot read property 'Timestamp' of undefined”? 未捕获的TypeError:无法读取未定义的属性“未定义” - Uncaught TypeError: Cannot read property 'undefined' of undefined 未捕获的TypeError:无法读取未定义的属性“数量” - Uncaught TypeError: Cannot read property 'quantity' of undefined 未捕获的TypeError:无法读取未定义的属性&#39;fromJSON&#39; - Uncaught TypeError: Cannot read property 'fromJSON' of undefined 未捕获的TypeError:无法读取未定义的属性“ timing” - Uncaught TypeError: Cannot read property 'timing' of undefined 未捕获的TypeError:无法读取未定义的属性&#39;formatter&#39; - Uncaught TypeError: Cannot read property 'formatter' of undefined Uncaught TypeError:无法读取未定义的属性“ stopVideo” - Uncaught TypeError: Cannot read property 'stopVideo' of undefined 未捕获的类型错误:无法读取未定义的属性“setCrossOrigin” - Uncaught TypeError: Cannot read property 'setCrossOrigin' of undefined 未捕获的TypeError:无法读取未定义的属性&#39;NaN&#39; - Uncaught TypeError: Cannot read property 'NaN' of undefined 未捕获的TypeError:无法读取未定义的属性&#39;getAttribute&#39; - Uncaught TypeError: Cannot read property 'getAttribute' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM