JQuery Mobile data-rel ="back"无法在对话框中工作

标签 jquery node.js jquery-mobile express pug

我正在尝试在我的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 mobile 中的错误?

谢谢

最佳答案

输出代码正确吗?你能过去吗?

您将 a 元素放在 html 语法中而不是 Jade 中,这可能是问题所在。

关于JQuery Mobile data-rel ="back"无法在对话框中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10577238/

相关文章:

javascript - HTML5/CSS3 - 内部带有谷歌地图的自定义形状 Div

javascript - jquery 插入数据到下一行

jquery - 使用 jQuery 按文本内容选择选项

JQuery 未在单击时运行

javascript - 插入排序最后一项未定义

node.js - nodejs/express - 立即将标准输出流式传输到客户端

node.js - 使用快速 session 的套接字 IO - socket.request.res undefined

jquery - jquery 中的 ListView

grails - 使用jQuery Mobile的Grails GSP页面片段链接问题

jquery - 当用户在搜索中键入内容时创建下拉菜单?