I'm setting up javascript that contains pathname for multiple URLS, but I don't want to set up a new "case" for the continual URL string.
Is there any possible solution to combine pathname cases instead of creating a new one?
switch (window.location.pathname) {
case '/blog/category/style':
$(".wsite-sideblock h2.wsite-title").append("Style");
break;
case '/blog/category/style/2':
$(".wsite-sideblock h2.wsite-title").append("Style");
break;
case '/blog/category/style/3':
$(".wsite-sideblock h2.wsite-title").append("Style");
break;
.
.
.
case '/blog/category/style/10':
$(".wsite-sideblock h2.wsite-title").append("Style");
break;
}
I had a thought that a simple trick is to add "+" like this... (but it didn't work)
case '/blog/category/style' + '/blog/category/style/2':