Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Youssef_A_
Beginner
99 Views

Start script on page load only happens once (document.ready)

I have 2 html files within my project: index.html and itemsList.html.

On start of the application a javascript code is started on index.html here is the index_user_scripts.js:

(function()
{
 "use strict";
 /*
   hook up event handlers 
 */
 function register_event_handlers()
 {
    
    
  $( document ).ready(function() {
      
            alert("index document is ready");

        });
       
     
    $(document).on("click", "#buttonSignIn", function(evt)
    {
                
activate_page("itemsList.html");
         return false;
    });
    
        /* a  #buttonSignIn */
    
    
    }
 document.addEventListener("app.Ready", register_event_handlers, false);
    
    
    
})();

I tried to do the same on the itemsList.html, but it doesn't work. I also tried: window.load, <body onload="script()">. Is there another way to start a script after loading html page on the xdk?

Tags (2)
0 Kudos
1 Reply
PaulF_IntelCorp
Employee
99 Views

Building multi-page apps in a Cordova app is tricky. We recommend you build a single-page app. See this Corodva doc > https://cordova.apache.org/docs/en/latest/guide/next/ <

Reply