【发布时间】:2018-06-04 04:28:54
【问题描述】:
我已经编写了一个 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,
});
}
【问题讨论】:
-
语法修复,代码格式化
标签: javascript jquery html treeview