Cordova:无法为我的多页应用程序添加新页面

Cordova : Can't add new page for my multi-page application

我是科尔多瓦的新手。我正在尝试构建一个多页面应用程序。创建项目后,它只有一个 index.html 文件。我编辑了页面并制作了我的第一页。现在我很困惑如何在 html 文件中添加我的第二页。我创建了一个按钮,我需要在单击该按钮时转到新页面。 我在 ubuntu 系统中使用 cordova。我是编程的初学者。谁能告诉我我的问题的解决方案?我使用 cordova+ionic 来构建页面,因为我不知道如何仅使用 cordova 创建页面。我使用离子框架制作了页面。但是不知道怎么添加新页面

<!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>

您正在使用 Ionic 框架。他们提供自己的 documentation and even an example of how to create a multi-view app with navigation.


下面是旧答案:

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.