Ara*_*nan 5 html javascript treeview jquery
我编写了一个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,
});
}
Run Code Online (Sandbox Code Playgroud)
$.getJSON('URL to JSON file', function(data){
//use data
});
Run Code Online (Sandbox Code Playgroud)
您可以使用 jquery getJSON。
| 归档时间: |
|
| 查看次数: |
52 次 |
| 最近记录: |