Good, it is in a development that includes a bootstrap menu and I wanted to leave marked which option is selected, for it I use a javascript.
It was working correctly until I added some more menu option, and that's when I've seen that in some cases, it does not go through the script.
I can not understand the difference between one option and another menu, I paste where the menu options and the script I use appear.
Drivers and companies work well, but in the documentation option the script does not work anymore, nor does it pass through it, like the first localhost, and the second localhost, which points to a different url, goes through the script but does not mark it as "active"
It is developed in django, I do not see that the problem is there, but maybe it is wrong, if you need to provide django code, you just have to ask for it.
Thank you very much for your time!
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
alert('principio');
$('li.active').removeClass('active');
$('a[href="' + location.pathname + '"]').closest('li').addClass('active');
alert('final');
});
</script>
<ul class="nav navbar-nav">
<li><a href="/accounts/"">Inicio<span class="sr-only">(current)</span></a></li>
</ul>
<ul class="nav navbar-nav">
<li><a href="/datos/listar-empresas/">Empresas<span class="sr-only">(current)</span></a></li>
</ul>
<ul class="nav navbar-nav">
<li><a href="/datos/listar-conductores/">Conductores<span class="sr-only">(current)</span></a></li>
</ul>
<ul class="nav navbar-nav">
<li><a href="/francia/listar-certificados-francia/">Documentación<span class="sr-only">(current)</span></a></li>
</ul>
<ul class="nav navbar-nav">
<li><a href="/francia/listar-certificados-francia/">Localhost<span class="sr-only">(current)</span></a></li>
</ul>
<ul class="nav navbar-nav">
<li><a href="/francia/listar-certificados-francia-backend">Localhost<span class="sr-only">(current)</span></a></li>
</ul>