我已经编写了一个jQuery代码,通过将硬编码的值分配给变量来获取数据。
我的要求是从一个json文件中获取相同的数据,有人可以帮忙修改这段代码吗?请查看下面的代码:
$(function () {
var jsonCalendarTreeStructure = [
{
text: 'Years',
nodes: [
{
text: '2013',
type: 'Y',
nodes: [
{
text: '13-Q1',
type: 'Q',
},
{
text: '13-01',
type: 'M',
},
{
text: '13-02',
},
{
text: '13-03',
}
]
}
]
}
];
$('#Dyanmic').treeview({
data: jsonCalendarTreeStructure,
});
}