jQuery URL actions
<p>Hy,</p>

<p>i have menu like this:</p>

<pre><code>&lt;a href=home&gt;Home&lt;/a&gt;
- &lt;a href=home/sub1&gt;Home Sub 1&lt;/a&gt;
- &lt;a href=home/sub2&gt;Home Sub 2&lt;/a&gt;
- &lt;a href=home/sub3&gt;Home Sub 3&lt;/a&gt;

&lt;a href=garden&gt;Garden&lt;/a&gt;
- &lt;a href=garden/sub1&gt;Garden Sub 1&lt;/a&gt;
- &lt;a href=garden/sub2&gt;Garden Sub 2&lt;/a&gt;
- &lt;a href=garden/sub3&gt;Garden Sub 3&lt;/a&gt;
</code></pre>

<p>Now i set the link url:</p>

<pre><code>$.address.init(function(event) {

$('a').address(function() {return $(this).attr('href').replace(location.pathname, '');});}).change(function(event) {

  var text = (event.value == '') ? 'Home' : 
  event.pathNames[0].substr(0, 1).toUpperCase() + 
  event.pathNames[0].substr(1);
  $('a').each(function() {
  $(this).toggleClass('selected', $(this).text() == text);
  });
 })
</code></pre>

<p>So if i click "Home" my URL --> www.web.com/#/home and on home sub 1 --> www.web.com/#/home/sub1.</p>

<ol>
<li>how to replace the unwanted "/#/"?</li>
<li>How can i read the actual url and if it matches eg: www.web.com/garden/sub1 take some action?
I want to use this so if people come to my website with a specific link, the actual navigation point should be open.</li>
</ol>

<p>Thx</p>
