I'm having issue with one of my cases not working. They all work except for one, which actually has queries in the URL, but they are always the same. The query URL looks like this: http://mywebsite.com/search/?q=label:Web-Design|label:Graphic-Design|label:Identity-Design|label:Brand-Design
It's not working and I'm wondering if windows.location supports queries in URL. It seems to me it wouldn't matter, but either way I cannot get this working.
I'm 100% positive that is the correct pathname, as I copied & pasted it, only to remove the domain just like the rest.
This is what I am using:
<script type='text/javascript'>
$(document).ready(function(){
switch (window.location.pathname) {
default:
$('.nav-blog').addClass('current');
break;
case '/p/about.html':
$('.nav-about').addClass('current');
break;
case '/':
$('.nav-home').addClass('current');
break;
case '/search/blog':
$('.nav-blog').addClass('current');
break;
case '/p/forums.html':
$('.nav-forums').addClass('current');
break;
case '/search/?q=label:Web-Design|label:Graphic-Design|label:Identity-Design|label:Brand-Design':
$('.nav-design').addClass('current');
break;
case '/p/photography.html':
$('.nav-photography').addClass('current');
break;
case '/p/hosting.html':
$('.nav-hosting').addClass('current');
break;
}
});
</script>