I think in this case it is better to change the server side.
Using javascript, you can:
var target = 0; switch( window.location.pathname ) { case "/tagged/Review": target = 1; break; case "/tagged/First_Look": target = 2; break; } document.getElementById("nav").getElementByTagName("li")[target].classList.add("active");
Put the code after loading the DOM.
If jquery, you can use:
var target = 0; switch( window.location.pathname ) { case "/tagged/Review": target = 1; break; case "/tagged/First_Look": target = 2; break; } $($("#nav li")[target]).addClass("active");
EDIT
window.onload or $ .ready is a way to find out if a document is loaded.
source share