Home >Web Front-end >JS Tutorial >js traverses the map content returned by json sample code_javascript skills

js traverses the map content returned by json sample code_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:18:30973browse
Copy code The code is as follows:

var yData = [];//Y-axis data
var xData = [];//X-axis data
$(data.rows).each(function(i){

var obj = data.rows[i];
// alert( obj.key);
// alert(obj.value);

yData.push(obj.key); //Dynamic value
xData.push(obj.value); / /Dynamic value
});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn