title: Cannot call methods prior to initialization; attempted to call method 'refresh'
body: <p>I'd like to update the value of a link-button by clicking on the item of a menu.</p>
  
  <p>Html:</p>
  
  <pre><code>&lt;div id="menu"&gt;
      &lt;ul data-role="listview" data-icon="false"&gt;
          &lt;li&gt;&lt;a href="#"&gt;Value A&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Value B&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;a href="#" id="selected" data-role="button"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>jQueryMobile:</p>
  
  <pre><code>$('#selected').hide();
  
  $("#menu li a").on('click',function(){
      $('#selected').html($(this).html()).slideDown().button("refresh");
  });
  </code></pre>
  
  <p>Text update works fine, but button css is not properly updated.</p>
  
  <p>I get the following error: </p>
  
  <blockquote>
    <p>Uncaught Error: cannot call methods on button prior to initialization;
    attempted to call method 'refresh'</p>
  </blockquote>
  
  <p>Which initialization are we talking about ? Page and button are already initialized, aren't they?</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>I also tried this :</p>
  
  <pre><code>$(document).on("mobileinit", function() {
  
      $('#selected').hide();
  
      $("#menu li a").on('click',function(){
          $('#selected').html($(this).html()).slideDown().button("refresh");
      });
  
  });
  </code></pre>
  
  <p>No error message any more; but no text update :(</p>