【发布时间】:2011-05-09 05:30:30
【问题描述】:
我是 android 中 phonegap 的新用户。我正在尝试在一个 html 文件中创建一个包含多个页面的项目,但它不起作用。 我使用的代码如下所示
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Page Title</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
<script src="http://code.jquery.com/jquery-1.5.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
<body>
<!-- Start of first page -->
<div data-role="page" id="foo">
<div data-role="header">
<h1>Foo</h1>
</div><!-- /header -->
<div data-role="content">
<h2>Foo</h2>
<p>I'm first in the source order so I'm shown as the page.</p>
<p>View internal page called <a href="#bar">bar</a></p>
<p>View internal page called <a href="#baz" data-rel="dialog" data-transition="pop">baz</a> as a dialog.</p>
</div><!-- /content -->
<div data-role="footer">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div><!-- /page -->
<!-- Start of second page -->
<div data-role="page" id="bar">
<div data-role="header">
<h1>Bar</h1>
</div><!-- /header -->
<div data-role="content">
<h2>Bar</h2>
<p>I'm the bar page.</p>
<p><a href="#foo" data-direction="reverse">Back to foo</a></p>
</div><!-- /content -->
<div data-role="footer">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div><!-- /page -->
<!-- Start of second page -->
<div data-role="page" id="baz">
<div data-role="header">
<h1>Baz</h1>
</div><!-- /header -->
<div data-role="content">
<h2>Baz</h2>
<p>I'm the baz page, viewed as a dialog.</p>
<p><a href="#foo" data-rel="back">Back to foo</a></p>
</div><!-- /content -->
<div data-role="footer">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div><!-- /page -->
</body>
</html>
请对此进行调查,感谢您在这方面提供的任何帮助。
【问题讨论】:
-
“它不工作”有点含糊,你有什么问题。我也假设 jQuery Mobile,虽然你没有这么说。最好查看整个文档,以便我们发现任何问题。
-
嗨,我正在使用此代码通过一个 HTML 文件创建多个页面。但我的输出仅在一个窗口中显示两个页面..请帮助我...
标签: jquery android html cordova