0

我在 android 上使用带有电话间隙的 jquery mobile 来创建移动应用程序。我在单个 html 文件中包含了两个页面。它没有按我的预期工作。下面是代码片段

<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/jquery.mobile-1.3.2.min.css"/>
    <script src="JQMobile/jquery-1.9.1.min.js"></script>
    <script src="JQMobile/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div data-role="page" id="pageone">
    <div data-position="fixed" data-role="header" data-theme="b">
        <h1>Mobile Portal</h1>
    </div>
    <div data-role="content">
        <div class="ui-grid-a">
            <div class="ui-block-a">
                <a href="#runticketsgrid" data-role="button">Tickets</a><br>
            </div>
            <div class="ui-block-b">
                <a href="#runticketsgrid" data-role="button">Second Column</a><br>
            </div>
        </div>
    </div>
</div>
<div data-role="page" id="ticketsgrid">
    <div data-role="header">
        <h1>Page Title</h1>
    </div>
    <!-- /header -->

    <div data-role="content">
        <p>Page content goes here.</p>
    </div>
    <!-- /content -->

    <div data-role="footer">
        <h4>Page Footer</h4>
    </div>
    <!-- /footer -->
</div>
</body>
</html>

在这里,当用户单击“Tickets” div 时,我想加载“ticketsgrid”页面,但它不起作用,有人可以帮我找出这个吗?

4

2 回答 2

1

改变

<a href="#runticketsgrid" data-role="button">Tickets</a><br>

<a href="#ticketsgrid" data-role="button">Tickets</a><br>

另一个链接也是如此。

工作示例:http: //jsfiddle.net/9SktP/1/

于 2013-10-16T09:42:48.160 回答
0
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>home</title>
    <link rel="stylesheet" href="themes/style.min.css" />
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile.structure-1.3.2.min.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js">  </script>
</head>    
<body>
    <div data-role="page" id="pageone">
        <div data-position="fixed" data-role="header" data-theme="b">
            <h1>Mobile Portal</h1>
        </div>
        <div data-role="content">
            <div class="ui-grid-a">
                <div class="ui-block-a">
                    <a href="demo.html#ticketsgrid"  data-transition="slide" data-role="none">Tickets</a><br>
                </div>
                <div class="ui-block-b">
                    <a href="demo.html#ticketsgrid" data-transition="slide" data-role="none">Second Column</a><br>
                </div>
            </div>
        </div>
    </div>
    <div data-role="page" id="ticketsgrid">
        <div data-role="header">
            <h1>Page Title</h1>
        </div>
        <!-- /header -->

        <div data-role="content">
            <p>Page content goes here.</p>
        </div>
        <!-- /content -->

        <div data-role="footer">
            <h4>Page Footer</h4>
        </div>
        <!-- /footer -->
    </div>
</body>     
</html> 
于 2013-10-16T12:44:31.773 回答