2012-01-15 6 views
0

モバイルウェブサイトを開発しようとしていますが、ダイアログボックスに固執しました。ウェブサイトはログインが成功した後にhome.phpにリダイレクトされ、データベースに次の>>ボタンが押されるとデータベースに値がフェッチされ、confirm.phpの前のhome.phpページの詳細が表示されます$ _POST []。私は使用していますhttp://jquerymobile.com/demos/1.0/jqueryモバイルを使用したときにページ読み込みエラーが発生しました

それはうまく動作し、confirm.phpページに新しいキャンセルボタンを追加しました。これは、ダイアログボックスのポップアップボックスとして "Confirm"と "Cancel"ボタンと共に開きます。 "確認"ボタンはhome.phpで行われた操作を元に戻しますが、問題なく動作します。問題は、ダイアログボックスに表示される「キャンセル」ボタンは、前のconfirm.phpページを完全にロードすることに戻りません。それはconfirm.phpページをロードしますが、完全にロードされません。

コード

home.php

> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta 
> name="viewport" content="width=device-width, initial-scale=1">  
> <title>Your Personal Health Record</title>  <link rel= "stylesheet" 
> href= 
> "http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" 
> /> 
>  <script src= "http://code.jquery.com/jquery-1.5.2.min.js"></script> <script src= 
> "http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script> 
> 
>  </head> 
>  <body> 
> 
>  <div data-role= "page"> 
>   <div data-role="header"> 
>  <h1>Welcome <?php echo $_SESSION['username']; ?>!</h1> 
>  <h1> Your Personal Health Record </h1> 
>   <a data-icon="arrow-l" class="ui-btn-right ui-btn ui-btn-icon-left ui-btn-corner-all ui-shadow ui-btn-up-c" 
> href="logout.php" rel="external" data-theme="c"> 
>    <span class="ui-btn-inner ui-btn-corner-all"> 
>     <span class="ui-btn-text">Logout</span> 
>     <span class="ui-icon ui-icon-arrow-l ui-icon-shadow"></span> 
>    </span> 
>   </a> </div> <form action="confirm.php" method="post"> 
>  <div data-role="fieldcontain"> <fieldset data-role="controlgroup"> 
>   <label for="fname">First Name:</label> 
>   <input type="text" name="fname" id="fname" value="<?php echo $rq['fname']; ?>" /> </fieldset> 
>   </div> 
>  <div data-role="fieldcontain"> <fieldset data-role="controlgroup"> 
>   <label for="lname">Last Name:</label> 
>   <input type="text" name="lname" id="lname" value="<?php echo $rq['lname']; ?>" /> 
>  </fieldset> 
>   </div> ..... ..... <div data-role="page" id="dialog"><!-- dialog--> 
> 
> <div data-role="header" data-theme="b"> <h1>Do you want to 
> cancel?</h1> </div><!-- /header --> 
> 
> <div data-role="content" data-theme="e"> <p>All changes made in the 
> previous step will be lost!</p> <a href="cancel.php" 
> data-role="button" data-theme="b">Confirm</a> <a href="confirm.php" 
> data-role="button" data-theme="b" data-rel="back">Cancel</a>  
> </div> </div> </body> 
> 
> </html> 

confirm.php

.... 
    ... 
    <div class="ui-grid-a"> 
     <a href="#dialog" data-theme="b" data-role="button" data-rel="dialog" data-transition="pop">Cancel</a> 
    </div> 
    .... 
    ... 

答えて

1

あなたのコードを示しています。

<a href="cancel.php" data-role="button" data-theme="b">Confirm</a> 
<a href="confirm.php" data-role="button" data-theme="b" data-rel="back">Cancel</a> 

だからあなたの 'CONFIRM' リンクが指されていますcancel.phpページとあなたの 'Ca ncel 'リンクはconfirm.phpページを指しています。すべきではありません:

<a href="confirm.php" data-role="button" data-theme="b">Confirm</a> 
<a href="cancel.php" data-role="button" data-theme="b" data-rel="back">Cancel</a> 
関連する問題