var brands = []; $(document).ready(function () { getBasketAsync(showBasketCountAsync); getBrands(); setCloseMenuHandler(); }); function getBrands() { AjaxJSONAsync("GET", "/Brand",null,paintBrands); } function paintBrands(brandResponse) { if (brandResponse == null) return; brands = brandResponse; paintCategory("juwelenGoud"); paintCategory("juwelenZilver"); //paintCategory("juwelenStaal"); paintCategory("uurwerken"); paintCategory("trouwen"); moveToLabel(); } function moveToLabel() { if ((window.location.hash == undefined) || (window.location.hash.trim() == "")) return; document.getElementById(window.location.hash.substr(1)).scrollIntoView(); } function paintCategory(category) { let HTML = ""; for (b in brands) { let brand = brands[b]; if (brand.category == category) { HTML += "
"; if ((brand.website != undefined) && (brand.website != "")) { HTML += ""; } HTML += ""; if ((brand.website != undefined) && (brand.website != "")) { HTML += ""; } HTML += "
"+brand.title+"
" HTML += "
"; } } document.getElementById(category).innerHTML = HTML; }