title: Why does a function call with jQuery components reload the xhtml page?
body: <p>I am working with JSF, Primefaces and Bootsfaces. I am developing a navbar and I must create a  dropmenu in navbar, however I had a problem with <code>b:dropmenu</code> implementation and I used another solution.</p>
  
  <p>My problem is when I on click in <code>Nombre de usuario</code> the page reloads if I call <code>mostrarOpcionesUsuario()</code>, but if I replace <code>mostrarOpcionesUsuario();</code> to <code>alert('hello!');</code>, the system shows <code>alert</code> and doesn't refresh the page. I need to call <code>mostrarOpcionesUsuario()</code> without refreshing the page.</p>
  
  <p>This is my code:</p>
  
  <p>XHTML:</p>
  
  <pre><code>&lt;b:navbar&gt;
      &lt;b:navbarLinks&gt;
          &lt;b:navLink onmousedown= "mostrarOpcionesUsuario(); return false;"&gt;
          &lt;div&gt;
              &lt;ul&gt;
                  &lt;li&gt;
                      &lt;div&gt;
                          &lt;span&gt;
                              Nombre de usuario
                          &lt;/span&gt;
                      &lt;/div&gt;
                      &lt;ul class = "ulOpciones"&gt;
                          &lt;li&gt;Web Design&lt;/li&gt;
                          &lt;li&gt;Web Development&lt;/li&gt;
                          &lt;li&gt;Illustrations&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
          &lt;/b:navLink&gt;
      &lt;/b:navbarLinks&gt;
  &lt;/b:navBar&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>function mostrarOpcionesUsuario() {
      $(".ulOpciones").css('visibility', function (i, v) {
          if (v == 'hidden') {
              $(".ulOpciones").css({'visibility': 'visible'});
          } else {
              $(".ulOpciones").css({'visibility': 'hidden'});
          }
      });
  }
  </code></pre>
  
  <p>Is the same case if I put <code>alert</code> in <code>mostrarOpcionesUsuario()</code>, the page doesn't reload, but with the previous <code>mostrarOpcionesUsuario</code> implementation, the page reloads.</p>
  
  <p>Help me, please!</p>
  
  <p>Thank you!</p>