title: php page include and set dynamic active li
body: <p>i have this code in include/menu.php</p>
  
  <pre><code>&lt;div class="collapse navbar-collapse navbar-ex1-collapse"&gt;
        &lt;ul class="nav navbar-nav side-nav"&gt;
           &lt;li&gt;&lt;a href="registrar_tiempo_carrera.php"&gt;&lt;i class="glyphicon glyphicon-paperclip"&gt;&lt;/i&gt; Registra tus tiempos de Competencias&lt;/a&gt;&lt;/li&gt;
           &lt;li&gt;&lt;a href="ver_tiempo_carrera.php"&gt;&lt;i class="glyphicon glyphicon-list-alt"&gt;&lt;/i&gt; Ver tus Marcas de Carreras&lt;/a&gt;&lt;/li&gt;
           &lt;li&gt;&lt;a href="agregar_amigos.php"&gt;&lt;i class="glyphicon glyphicon-user"&gt;&lt;/i&gt; Agrega tus Amigos&lt;/a&gt;&lt;/li&gt;
           &lt;li&gt;&lt;a href="ranking.php"&gt;&lt;i class="glyphicon glyphicon-globe"&gt;&lt;/i&gt; Rankings Generales&lt;/a&gt;&lt;/li&gt;
           &lt;li&gt;&lt;a href="contacto.php"&gt;&lt;i class="glyphicon glyphicon-envelope"&gt;&lt;/i&gt; Reportar un Problema&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In the index.php</p>
  
  <pre><code> &lt;body&gt;
    &lt;?php include ('include/menu.php'); ?&gt;
  </code></pre>
  
  <p>Result: <a href="http://lazaro.inf.uct.cl/~dacanalesc/registratusmarcas/" rel="nofollow noreferrer">http://lazaro.inf.uct.cl/~dacanalesc/registratusmarcas/</a></p>
  
  <p>and in the menu.js put methods for set li active dynamically, but nothing work </p>
  
  <p>example:</p>
  
  <pre><code>$('ul li a').click(function() {
    $('ul li.active').removeClass('active');
    $(this).closest('li').addClass('active');
  });
  </code></pre>
  
  <p>my question is: with mi menu inside in another page, and in the main page include it. Require other method for put active class on li?</p>
  
  <p>EDIT:
  <a href="https://stackoverflow.com/questions/11533542/twitter-bootstrap-add-active-class-to-li">Twitter Bootstrap add active class to li</a>
  the first answer works for me.</p>