title: jQuery to parse our a part of a url path
body: <p>I need to parse long urls and set a variable (category) equal to one of the <code>/folders/</code> in the path.</p>
  
  <p>For example, a url that is </p>
  
  <p><code>http://example.com/community/home/whatever.html</code></p>
  
  <p>I need to set the variable equal to whatever folder path comes after <code>/home/</code> in that url.</p>
  
  <p>I've got this to alert me with what comes after /community/, but then the url turns to NaN and the link doesnt work. I think I'm not on the right track.</p>
  
  <pre><code>if ($(this.href*='http://example.com/community/')){
  
    var category = url.split("community/");
  
    alert(category[category.length - 1]);
  
  }
  </code></pre>
  
  <p>Thoughts?</p>
  
  <p>TIA.</p>