Tag Archive for: views

Get local html files (views/widgets) and insert them into your Cordova Single Page Application

Approach to load different views into an Android SPA.

  1. An index.html file with all the scripts, styles and so on.
  2. HTML, CSS and JS files at least as many as views in folders called view, css and js respectively and with the same names to not mess around. Ex: page.html, page.css and page.js
  3. We can use Axios to load views instead of the typical XMLHttpRequest that follows:

Navigation between pages/views

Using an array to keep track of where we came from. Try it, click the right top buttons to navigate and check the backward arrow, any time you go to the Main page the tracking will be reseted.