Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

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

Youssef_A_
Beginner
682 Views

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?

0 Kudos
1 Reply
PaulF_IntelCorp
Employee
682 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/ <

0 Kudos
Reply