title: Difference between $(document).ready and $(document).on('pageinit')
body: <p>I'm using jquery mobile and I'd like to reproduce this code:</p>
  
  <pre><code>$(document).ready(function () {
      $.mobile.loading('show');
  });
  </code></pre>
  
  <p>it shows the spinner until I decide to hide it using in other functions</p>
  
  <pre><code>$.mobile.loading( 'hide' );
  </code></pre>
  
  <p>Now I see that document.ready() is deprecated in jquery mobile 1.2, so they suggest to replace it with <code>$(document).on('pageinit')</code></p>
  
  <p>But If I replace my code with the suggested one the spinner autohide... why? This is the new code:</p>
  
  <pre><code> $(document).on('pageinit',function(){
       $.mobile.loading( 'show' );
   });
  </code></pre>