Сообщение от Art!P
|
из базы могу выгрузить в виде:
1, 'Arts', '/arts/'
2, 'Animation','/arts/animation/'
3, 'Anime', '/arts/animation/anime/'
3, 'Artists', '/arts/animation/artists/'
1, 'Business', '/business/'
2, 'Accounting', '/business/accounting/'
3, 'Associations', '/business/accounting/associations/'
3, 'Business-to-Business', '/business/accounting/business-to-business/'
|
Плохой вариант...
Если выгружать так уже вот так
var obj=[
{
name: 'Arts',
dir: '/arts/',
child: [
{
name: 'Animation',
dir: '/arts/animation/',
child: [
{
name: 'Anime',
dir: '/arts/animation/anime/'
},
{
name: 'Artists',
dir: '/arts/animation/artists/'
}
]
}
]
},
{
name: 'Business',
dir: '/business/',
child: [
{
name: 'Accounting',
dir: '/business/accounting/',
child: [
{
name: 'Associations',
dir: '/business/accounting/associations/'
},
{
name: 'Business-to-Business',
dir: '/business/accounting/business-to-business/'
}
]
}
]
}
];
Т.о. можно будет сразу работать с данными на странице...