Software Archive
Read-only legacy content
17061 Discussions

Only 1 page allowed under Intel XDK/Cordova call to cordova.js

Dallas_T_1
Beginner
487 Views

I am creating a 2 page app that has an index.html and app.html page. Each page has a corresponding index.js and app.js javascript file. When I load the cordova.js in index,html at the header level as <script type="text/javascript" src="cordova.js"></script> it doesn't allow the app.html page to be alled through index.js. I click the button which calls it and nothing happens. If I remove the line for calling cordova.js, I get the popup saying cordova.js could not be found. How do you set up an app to be allowed to have a second page under Intel XDK/Cordova? I saw write ups on hacking some of the files created, but there has to be a logical way to be able to have cordova and more than a 1 page app. 

 

0 Kudos
1 Reply
PaulF_IntelCorp
Employee
487 Views

See this Cordova doc page > https://cordova.apache.org/docs/en/5.1.1/guide/next/index.html note the title of the first point "SPA Is Your Friend." You should built multiple "pages" by hiding and showing <div> elements that correspond to the pages. You lose your JavaScript context and have to reload cordova.js with each page, it also results in much slower transitions between pages to use multiple html files.

0 Kudos
Reply