I have menu with different classes and one of them is photos, for photos button and for photos page.
When you click on the button photos you get in url /index.php?t=photos
What is the best way to find that ?t=photos
with javascript
or jquery
and then do something if url contains this.
I tried :
if (window.location.href.indexOf("?t=photos") >= 0) {
$('.photos').css("border-color" , "#B40404");
}
UPDATE:
I did it like this:
var requestUrl = window.location.search.toString();
if (requestUrl.indexOf('&t=photos') > -1) {
$('.photos').css("border-color","#B40404");
}