if (navigator.userAgent.search(/Edge/) > 0 || navigator.userAgent.search(/MSIE/) > 0 || navigator.userAgent.search(/NET CLR /) > 0) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var myArr = JSON.parse(this.responseText); myArr.forEach(function(o){ const image = document.createElement('img'); image.setAttribute('src', o.image.src); image.classList.add('lazy-loading'); document.getElementById('img' + o.id).appendChild(image); if(o.subtitle != "undefined") { var descrp = ". "+o.subtitle+"";} else {descrp = "";} document.getElementById('news-item--' + o.id).insertAdjacentHTML("beforeend", "
"+ o.title + descrp +"
"+ o.date + "
"); }); } }; xmlhttp.open("GET", "/json/front.json", true); xmlhttp.send(); }