Skip to content

Instantly share code, notes, and snippets.

@arturmkrtchyan
Last active March 17, 2021 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arturmkrtchyan/aff28cbd7ff3990678eb8b2505e388c5 to your computer and use it in GitHub Desktop.
Save arturmkrtchyan/aff28cbd7ff3990678eb8b2505e388c5 to your computer and use it in GitHub Desktop.
<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