1

ボタンを作成しました

<a data-role="button">

ポップアップ内。ここにポップアップがあります:

<div data-role="popup" id="popupRegister" data-theme="a" data-dismissible="false">
    <div data-role="header" data-theme="b" class="ui-header ui-bar-b" 
             role="banner">
        <h1 class="ui-title" role="heading" aria-level="1">Success!!</h1>
    </div>
    <div data-role="" data-theme="a" class="ui-body-a" 
       role="main" style="padding:15px;">
      <h1>Thank you for regestering with us.</h1>
      <p>You may now continue to the app.</p>

       <!-- this is the button -->
      <a href="#" id="takeMeHome" data-role="button" data-rel="back" 
       data-theme="a" data-inline="true" 
       data-corners="true" data-shadow="true" 
       data-iconshadow="true" data-wrapperels="span" 
       class="ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-up-a">
       <span class="ui-btn-inner"><span class="ui-btn-text">GO</span></span>
      </a>       
     </div>
</div>

ボタンをクリックするconsole.logと応答しますが、ページがリダイレクトされません。なんで?リダイレクト方法は次のとおりです。

$("#takeMeHome").click( function(){
    console.log("lets go home");
    //window.location.href = "home.html";
    //localStorage.registered=true;
    //window.location.replace("home.html");
    window.location.href = ("home.html");
});
4

1 に答える 1

3

交換

window.location.href = ("home.html");

$.mobile.changePage('home.html');

data-history="false"そしてポップアップdivに追加します。

于 2013-08-27T17:24:18.473 に答える