I am new to cordova. I am try to build a multi page application. After I created the project, it has only one index.html file. I edited the page and made my first page. Now I am confused that how to add my second page in that html file. I created a button I need to go to the new page when I click on the button. I am using cordova in my ubuntu system. I am a beginner in programming. Can anyone tell me the solution for my problem? I used cordova+ionic to bulid the page,because I don't know how to create pages using cordova only. I made the page using ionic framework. But don't know how to add new page.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
</head>
<body ng-app="starter">
<ion-pane>
<ion-header-bar class="bar-stable">
<h1 class="title">TREASURE HUNT</h1>
</ion-header-bar>
<ion-content>
<!--section id="first_page"-->
<div class="list card">
<div class="item item-body">
<img class="small-image" src="treasurehunt.png" height="200dp" width="fill_parent"><br/>
<div class="list">
<label class="item item-input">
<input type="text" placeholder="Email">
</label>
<label class="item item-input">
<input type="password" placeholder="Password">
</label>
</div>
<a class="button icon-right ion-chevron-right button-calm" href="#clients">Login
</a></br></br><a href="#">Sign Up</a></div></div></ion-content>
</ion-pane>
</body>
</html>
You're using the Ionic framework. They provide their own documentation and even an example of how to create a multi-view app with navigation.
Old answer below:
Cordova is not too different to using a very simple linux server.
Use a anchor element to link to the second page using relative URL.
<a class="button icon-right ion-chevron-right button-calm" ref="clients.html">Login</a> ^ | notice the .html?
The biggest thing to remember is that Cordova is a tool to get your HTML/JS/CSS onto a mobile device.
Adding a page to your App is like adding a page to a website.
Create another HTML document and link to it using an anchor tag. You will need to include all the relevant scripts and styles for that page.