jquery移动对话框通过链接调用diallog不起作用

jquery移动对话框通过链接调用diallog不起作用,jquery,jquery-mobile,dialog,Jquery,Jquery Mobile,Dialog,我在本文件中定义了两个简单页面: //page1 ... <a href="#dialog" id="link_open_dialog" data-rel="dialog">Click me</a> ... //page2 <div data-role="page" id="dialog"> <div data-role="header">

我在本文件中定义了两个简单页面:

 //page1
         ...
         <a href="#dialog" id="link_open_dialog" data-rel="dialog">Click me</a>
         ...

 //page2
    <div data-role="page" id="dialog">           
         <div data-role="header">
                <h1>Something</h1>
          </div>
          <div data-role="content" id="textDialog">
              something
          </div>  
     </div>   
//第1页
...
...
//第2页
某物
某物

但问题是我看不到对话框,从来没有………是我认为最简单的情况,我不熟悉这个插件,但看起来你需要将
数据角色指定为
“按钮”
,否则不会触发任何事件。。。只是猜测而已

<a data-role="button" data-rel="dialog">hello</a>

    <div data-role="dialog">Hello World</div>
你好 你好,世界
我认为您没有正确定义jQuery Mobile的引用,或者您可以检查控制台是否有错误

请尝试以下工作示例:

<html>
    <head>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile.structure-1.1.1.min.css" />
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
        <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script> 
    </head>

    <body>
        <!-- PAGE 1 -->
        <div id="page_1" data-role="page">
            <div data-role="content">
                <a href="#dialog" id="link_open_dialog" data-rel="dialog">Click me</a>
            </div>
        </div>

        <!-- PAGE 2: DIALOG -->
        <div data-role="page" id="dialog">           
            <div data-role="header">
                <h1>Something</h1>
            </div>
            <div data-role="content" id="textDialog">
                something
            </div>  
        </div>  
    </body>
</html>

某物
某物

问题是模板中的一个参数。与jquery Mobile无关。参数是一个空链(“”),但我不知道这一点,因为该部分并不完整,所以很难对其进行测试。非常感谢,我花了几个小时来解决这个简单的问题

嗨!您是否正确加载了jQuery移动引用?你检查过你的控制台了吗?这是我文档的开头,有不同的页面,我加载了所有的js和css!,嗯,现在我可以开始认为我没有疯了。非常感谢。我将尝试发现发生了什么,这与我的模板具有相同的结构。非常感谢。我想好了会写信的something@MrQ.C. : 我提供的示例确实有效!您可以提供有关您的问题的更多详细信息(例如:可能存在任何控制台错误?)。。。