gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 07:03:02 24 4
gpt4 key购买 nike

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

<!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甚至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.

关于javascript - Cordova : Can't add new page for my multi-page application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31940383/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com