【发布时间】:2011-04-17 01:56:34
【问题描述】:
我用 HTML/CSS 创建了一个应用程序。它在 iPhone 上运行良好。现在我正在使用 Eclipse 中的 PhoneGap 将它移植到 Android。我已使用此页面作为起点:phonegap / phonegap-android-eclipse-quickstart 当我按照该教程并在我的 eLocity 中打开它时,它会正确启动,并打开 index.html 作为主页。
我的新 index.html 页面替换了上面教程中使用的页面,其中充满了 <li></li> 列表中的普通 HTML <a href="1000.html"> 链接,这些链接将您带到同一文件夹 (www) 或下一个文件夹中的其他 HTML 页面文件夹(章节/1000.html)。但是当我在我的 eLocity 平板电脑中启动它时,链接不会触发。 <li> 区域会变成应有的蓝色,但页面不会改变。
为什么普通的 HTML 链接不起作用?我在 Eclipse 中没有收到任何错误消息。
这里是 index.html 的开头:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -->
<html>
<head>
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="minimum-scale=1.0, width=device-width, user-scalable=no" name="viewport">
<link href="Chapters/hymns-style.css" rel="stylesheet" type="text/css">
<link href="Chapters/style.css" rel="stylesheet" type="text/css">
<title>Husting Pocket Hymnal</title>
</head>
<body style="background-color:#00aaff">
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<!-- <script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", function() {
alert('initialized');
}, true);
</script>
-->
<div id="content">
<span class="graytitle">Husting Pocket Hymnal</span>
<ul class="pageitem">
<li class="menu">
<span class="name"><a href="Chapters/hymns-a.html">Hymns A</a></span>
</li>
<li class="menu">
<span class="name"><a href="Chapters/hymns-b.html">Hymns B</a></span>
</li>
这是它转到的页面的开头。 ** 所有这些 HTML 链接都有效:**
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="minimum-scale=1.0, width=device-width, maximum-scale=0.6667, user-scalable=no" name="viewport">
<link href="hymns-style.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<title>Hymns A</title>
</head>
<body>
<div id="content">
<span class="graytitle">Hymns A</span>
<br>
<ul class="pageitem">
<li class="menu">
<span class="name"><a href="0300.html">
A debtor to mercy alone
<span class="detailbutton"></span></span></a>
</li>
<li class="menu">
<span class="name"><a href="0301.html">
A lamp in the night, a song in time of sorrow
<span class="detailbutton"></span></span></a>
</li>
【问题讨论】: