function category_products(query,category_id) { var b = document.getElementById('products_more_'+category_id); var c = document.getElementById('links_page'); var d = document.getElementById('category_products_'+category_id); if(b) { b.innerHTML = 'loading'; if(b.classList.contains("loading")==false) b.classList.add('loading'); } else if(c && query.indexOf('links_page')) { c.innerHTML = 'loading'; if(c.classList.contains("loading")==false) c.classList.add('loading'); } var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { d.innerHTML += this.responseText; } else { return true; } }; xhttp.open("GET", "/shop/category_products.php?t=1565838788&"+query, true); xhttp.send(); } function search_products(query,category_id) { var b = document.getElementById('products_more_'+category_id); if(document.getElementById('products'+category_id)) var d = document.getElementById('products'+category_id); else var d = document.getElementById('products'); if(b) { b.innerHTML = 'loading'; if(b.classList.contains("loading")==false) b.classList.add('loading'); } var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { d.innerHTML += this.responseText; } else { return true; } }; xhttp.open("GET", "/shop/category_products.php?t=551129700&"+query, true); xhttp.send(); }