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
- <script>
- $( document ).on( "pageinit", "#page1", function() {
-
- console.log('Entra al Page Init');
- $(".catItem").click(function(){
-
- var id=$(this).attr("id");
- $.mobile.changePage( "Personal.php", { reloadPage: false, transition: "none",type: "post",data: 'idCat='+id} );
- });
- });
- </script>
-
- <div data-role="page" id="page1" >
- ....
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
- <script>
- $( document ).on( "pageinit", "#page1", function() {
- console.log('Second');
- });
- </script>
- <div data-role="page" id="Pagina2" >
- ....
I hope you can help me.