I have two .json files
data_prod_ind.json
{"articles":
[ { "title":"bla bla" } , { "title":"bla bla" } ]
}
data_prod_ind_epif.json
{"names":
[ { "title":"bla bla" } , { "title":"bla bla" } ]
}
html
<div id="mn_1" class="mn_sb" data-articleidx="0">CONTROL RELAY</div>
...
<div id="tt_mn"></div>
<div id="content_mn"></div>
script
var idx = $(this).data('articleidx');
$.getJSON("auth/data_prod_ind.json", function(data) {
$("#tt_mn").html($("<p class='prod_c'>" + data.articles[idx].title + "</p>"));
$("#content_mn").html($("<p class='prod_d'>" + data.names[idx].title + "</p>"));
});
I think there would be better only one json file in which it could be:
{"articles":
[ { "title":"bla bla" } , { "title":"ble ble" } ]
}
{"names":
[ { "title":"blo blo" } , { "title":"blu blu" } ]
}
And I say that because it only show the content in data_prod_ind.json , not the other one.