Regular expression to check current website location - small isssue
<p>I have this jquery code to highlight menu item corresponding to current page in my browser: </p>

<pre><code>    $(document).ready(function (){

    $("ul#nav a").each(function (){

    var hrefWindow = $(this).attr("href");

    if (hrefWindow == window.location.href.match(/[^/]+$/g)) {
        $(this).parent().addClass("active");
    }
    else {
        $(this).parent().removeClass("active");
    };        
});      
})
</code></pre>

<p>As you can see expression is looking for string which is just after slash in my web address like: </p>

<p>www.mywebsite.com/thisStringWillBeFoundByExpression , </p>

<p>everything works fine but there is small issue when I type my domain address for the first time as there will be only www.mywebsite.com (without index.htm after slash) in address bar and my expression won't find a thing. </p>

<p>How to modify my code to add class 'active' to index.htm in case if there is only www.mywebsite.com in the address bar?</p>
