$(document).ready(function () { $.ajax({ url: "/tea/assets/json/index.json", type: "get", data: {}, contentType: "application/json; charset=utf-8", dataType: "json", cache: false, success: function (data) { var slider = data.silder; var card = data.card; var cardTitle = data.cardtitle; var carddetail = data.carddetail; var sliderhead = data.sliderhead; var slidertitle = data.slidertitle; var sliderdec = data.sliderdec; var kvtitle = data.kvtitle; var kvdec = data.kvdec; var othertitle = data.othertitle; var otherdec = data.otherdec; $(".kvTitle").text(kvtitle); $(".kvDec").text(kvdec); $(".indexCardTitle").text(cardTitle); $(".indexCardDetail").text(carddetail); $(".sliderHeard").text(sliderhead); $(".sliderTitle").text(slidertitle); $(".sliderDec").text(sliderdec); $(".otherTitle").text(othertitle); $(".otherDec").text(otherdec); // var job_function_item = data.job_function.name; // console.log(job_function); $.each(slider, function (index, item) { $('
'+item.title+'
').appendTo("#slider"); }); $('#slider').owlCarousel({ autoplay: true, nav: true, dot: false, loop: true, smartSpeed: 1000, margin: 0, responsive: { 0: { items: 1 } } }); $.each(card, function (index, item) { $('
'+item.title+'

'+item.title+'

'+item.dec+'

').appendTo(".cardWrap"); }); }, error: function (xhr, status, errorThrown) { console.log(errorThrown + "\n" + status + "\n" + xhr.statusTex); }, }); $.ajax({ url: "/tea/assets/json/footer.json", type: "get", data: {}, contentType: "application/json; charset=utf-8", dataType: "json", cache: false, success: function (data) { var social = data.social; // var job_function_item = data.job_function.name; // console.log(job_function); $.each(social, function (index, item) { $('').appendTo(".socialMedia"); }); }, error: function (xhr, status, errorThrown) { console.log(errorThrown + "\n" + status + "\n" + xhr.statusTex); }, }); });