pageinit, does not work on the second page

pageinit, does not work on the second page

I have the first page and run the PageInit, starting the page, print a console.log ('Done');

I have this code:

categories.php
  1. <script>

  2. $( document ).on( "pageinit", "#page1", function() {
  3. console.log('Entra al Page Init');

  4. $(".catItem").click(function(){
  5. var id=$(this).attr("id");
  6. $.mobile.changePage( "Personal.php", { reloadPage: false, transition: "none",type: "post",data: 'idCat='+id} );
  7. });
  8. });
  9. </script>
  10. <div data-role="page" id="page1" >
  11. ....


When the second page load, not load the PageInit, I have to make a load manually. with F5

This is my second page:

personal.php

  1. <script>

  2. $( document ).on( "pageinit", "#page1", function() {
  3. console.log('Second');
  4. });
  5. </script>

  6. <div data-role="page" id="Pagina2" >
  7. ....
I hope you can help me.