title: Add class to current page link with jQuery only works for relative but not absolute links
body: <p>I am adding a class to the link to the current page using the following code:</p>
  
  <pre><code>var pathname = window.location.pathname;
  $("ul#inventory-categories a").each( function() {
      var href= $(this).attr("href");
      if (href.length &amp;&amp; pathname.indexOf(href) &gt;= 0){
          $(this).addClass("active");
      }
  });
  </code></pre>
  
  <p>This works fine for relative links but not absolute links. </p>
  
  <p>Can anyone offer any insight?</p>