こんにちは、divにさまざまなページがあるというhtmlファイルがあります。これで、あるページから別のページに移動したいのです$.mobile.changePage("#test")
が、test.html への移動は行われません。test.html に別の html ファイルを使用してそれを呼び出すと$.mobile.changePage(("test.html"));
、ナビゲーションが行われます。
loadPage も試しましたが、問題は解決しません。どんな提案でも大歓迎です、前もって感謝します。
これが私のコードです:
<body>
<div data-role="page" id="firstPage" onclick=callSecondPage() class="type-home">
<div data-role="button">
<input type="submit" data-role="button" value="firstPage" id="firstPage">
</div>
<script type="text/javascript">
function callSecondPage()
{
alert ("Inside callPage");
$.mobile.changePage('#secondPage');
}
</script>
</div>
<div data-role="page" id="secondPage" onclick=callThirdPage() class="type-home">
<div data-role="button">
<input type="submit" data-role="button" value="secondPage" id="secondPage">
</div>
<script type="text/javascript">
function callThirdPage()
{
alert ("Inside callPage");
$.mobile.changePage('#thirdPage');
}
</script>
</div>
<div data-role="page" id="thirdPage" onclick=callFourthPage() class="type-home">
<div data-role="button">
<input type="submit" data-role="button" value="thirdPage" id="thirdPage">
</div>
<script type="text/javascript">
function callFourthPage()
{
alert ("Inside callPage");
$.mobile.changePage('#fourthPage');
}
</script>
</div>
<div data-role="page" id="fourthPage" class="type-home">
<div data-role="button">
<input type="submit" data-role="button" value="fourthPage" id="fourthPage">
</div>
</div>
<div data-role="page" id="fifthPage" class="type-home">
<div data-role="button">
<input type="submit" data-role="button" value="fifthPage" id="fifthPage">
</div>
</div>
<div data-role="page" id="sixthPage" class="type-home">
<div data-role="button">
<input type="submit" data-role="button" value="sixthPage" id="sixthPage">
</div>
</div>
上記のhtmlファイルに来る前に、他のページに移動します.そして今、$.mobile.changePage('#secondPage');
secondPageはfirstPageから移動されません. しかし、同じコードを index.html (つまり、アプリケーションのエントリ ポイント) に配置すると、適切なナビゲーションが行われます。