Edit in JSFiddle

function stripSlash(str) {
    if(str[str.length - 1] == '/') {
        return str.substr(0, str.length - 1);
    }
    return str;
  }
  $('nav a').each(function(){
    if(stripSlash($(this).attr('href')) == stripSlash(document.URL)){
      $(this).addClass('active');
    }
  });
<nav>
    <a href="http://www.5alarmint.com">My Portfolio Site</a>
    <a href="http://fiddle.jshell.net/PqCuc/3/show/light/">JSFIDDLE</a>
    <a href="http://www.google.com">Google</a>
</nav>
.active{color:#ff0000;}