首页 > 代码库 > bobo遍历JSON

bobo遍历JSON

$("#HomeData").live("click", function () {
$.post("/Home/NewIndex/TransactionData", function (data) {
if ($.browser.msie) {
// alert(11);
var ii = 5;
$.each(data, function (k, v) {
var key = k;
var value = http://www.mamicode.com/data[k];
aMonth[ii] = key + "月";
aValue[ii] = value;
ii--;
});
} else if ($.browser.webkit && !window.chrome) {
// alert(22);
var ii = 5;
$.each(data, function (k, v) {
var key = k;
var value = http://www.mamicode.com/data[k];
aMonth[ii] = key + "月";
aValue[ii] = value;
ii--;
});
}
else {
// alert(33);
var ii = 0;
$.each(data, function (k, v) {
var key = k;
var value = http://www.mamicode.com/data[k];
aMonth[ii] = key + "月";
aValue[ii] = value;
ii++;
});
}
});
});

$("#HomeData").click();