내 JSON 파일에서 중첩 된 데이터를 가져 오는 데 문제가 있습니다.JSON의 중첩 된 데이터
아무도 도와 줄 수 있습니까? 나는 메가 메뉴를 만들려고 노력하고있다. 여기
$.getJSON("js/nav.json", function (data) {
$.each(data.navigation, function (i, navigation) {
var jsondata = "<li class='top-level'><a href='/" + this.link + "'>" + this.title + "</a></li>";
$.each(this.headingArray, function() {
alert(hello);
});
$(jsondata).appendTo("ul.nav");
});
});
});
그리고 샘플 JSON 파일 메신저
{
"navigation": [
{
"title": "Home",
"link": ""
},
{
"title": "Find your ski holiday",
"link": "#URLhere",
"headingArray": [
{
"heading": [
{
"title": "Destinations",
"link": "#URLhere",
"subheading": [
{
"title": "Andorra",
"link": "#URLhere"
},
{
"title": "Austria",
"link": "#URLhere"
},
어떤 도움에서 읽고 훨씬하십시오 주시면 감사하겠습니다?
데모 - http://dev.thirstythursdays.co.uk/menu-json3 당신의 객체가 서로 다른 특성을 가지고 있기 때문에
질문 *에 대해 좀 더 구체적으로 설명해 주실 수 있습니까? – Friederike