1

Express.js プロジェクトで jquery モバイル ダイアログを使用してエラーを表示しようとしています。エラーのあるダイアログを正常に表示できましたが、ダイアログの閉じるボタンをクリックすると、ブラウザがホームページに戻ってからダイアログに戻るという問題があります。これが私のコードです:

div#home(data-role='page',data-theme="f",data-url='/')
    header(data-role='header')
        h1= title
    div(data-role='content',role='main')
      -if(typeof error !== "undefined")
         script(type='text/javascript')
          $(function() {
           $('#dialogbody').html("<p>#{error}</p>");
           $.mobile.changePage('#dialog', 'pop', true, true);
          });
      -if(typeof info !== "unddefined")
         script(type='text/javascript') 
          $.mobile.changePage('#dialog', 'pop', true, true);
      form(name='home',action='/', method='POST')   
       div(data-role='fieldcontain')
        fieldset(data-role='controlgroup')
         label.label(for='email') email
         input.input.required.email(id='email',type='text',value='',placeholder='name@email.com',name='email')
         label.label(for='password') password
         input.input.required(id='password',type='password',value='',placeholder='Enter your password',name='password')
        fieldset.ui-grid-a
          div.button.ui-block-a
             input.button(type='submit',value='Sign In',data-transition='fade',data-theme='a',style='width: 100%;')
          div.ui-block-b   
             input(type='submit',value='Sign Up',data-transition='fade',data-theme='b',onclick="home.action='/signup'; return true;")
        div
             a( data-transition='fade', data-theme='a',href=paypalURL) 
div(id='dialog',data-role='dialog',data-overlay-theme='a',data-transition='pop')
        div(data-role='content')
            div (id='dialogbody') 
            <a href="#" data-role="button" data-rel="back" data-theme="a">Close</a>

見逃したものはありますか、それとも JQuery モバイルのバグですか?

ありがとう

4

1 に答える 1

0

出力コードは正しいですか?あなたはそれを過ぎてもらえますか?

a 要素を Jade ではなく html 構文に配置すると、問題が発生する可能性があります。

于 2012-05-14T13:38:40.387 に答える