How to switch the active navigation link in Bootstrap a navigation bar without writing additional javascript?

advertisements

Is there a simple way to toggle the active link in a basic bootstrap navbar without writing any javascript?

Here's my navbar

<div class="navbar navbar-static-top">
    <div class="navbar-inner">
        <div class="container">
            <div>
                <ul class="nav" ng-show="isAuthenticated">
                    <li class="active"><a href="/activity/create">Create Activity</a></li>
                    <li><a href="/activity/manage">Manage Activities</a></li>
                    <li><a href="/activity/su">Super User</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>


Well, im not 100% sure (im not that good with javascript), but you could do a few if statements.

if($url=="/activity/create") {echo "class='active'";}

This is the php syntax. Try something out with JS.

BTW you are using node.js which is JS, so you wouldnt be able to do it without JS.