function runAfterElementExists(jquery_selector, callback) {var checker = window.setInterval(function() {if ($(jquery_selector).length) {clearInterval(checker);callback();}}, 500);} function goBack(){if (document.referrer.indexOf(window.location.host) !== -1) {history.go(-1); return false;}}; document.addEventListener('DOMContentLoaded', function() { if (document.referrer.indexOf(window.location.host) !== -1) {$('.goBackLink').removeClass('d-none');} var catURL = $('.breadcrumb li:nth-last-child(2)>a').attr('href');$('.single a.parentCatlink').attr("href", catURL); });