Last active
March 17, 2021 11:31
-
-
Save arturmkrtchyan/aff28cbd7ff3990678eb8b2505e388c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
const category = getUrlParam('category'); | |
if(category) { | |
const existCondition = setInterval(function() { | |
if ($('span[data-value="' + category.trim() + '"]').length) { | |
$('span[data-value="' + category.trim() + '"]').click(); | |
clearInterval(existCondition); | |
} | |
}, 100); | |
} | |
function getUrlParam(name) { | |
const url = new URL(window.location.href); | |
return url.searchParams.get(name); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment