Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在JqueryMobile中以单个html使用两个页面_Html_Jquery Mobile_Cordova - Fatal编程技术网

在JqueryMobile中以单个html使用两个页面

在JqueryMobile中以单个html使用两个页面,html,jquery-mobile,cordova,Html,Jquery Mobile,Cordova,我正在使用android上带有phone gap的jquery mobile创建一个移动应用程序。我在一个html文件中包含了两个页面。它没有像我预期的那样工作。下面是代码片段 <!DOCTYPE html> <html > <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1">

我正在使用android上带有phone gap的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”页面,但它不工作,有人能帮我找到这个吗

变化

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


另一个链接也是如此

工作示例:


家
移动门户


页面标题 页面内容在这里

页脚
谢谢,但手机仍然无法使用,是否有任何有效的理由更改href标记Yes,因为href标记的值必须是您的目标id。如果不相同,它就不能工作。什么是
#runticketsgrid
?我错了,应该是“ticketsgrid”
<a href="#ticketsgrid" data-role="button">Tickets</a><br>
<!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>