0

我正在使用 JQuery-mobile 开发移动应用程序,并且我的对话框出现问题,每次我尝试关闭对话框(使用默认关闭按钮)时,应用程序都会冻结。

头部代码:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> <!-- JQuery Mobile CSS link -->

<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <!-- JQuery Mobile link stored on CDN-->
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script> <!-- JQuery Mobile link stored on CDN -->

相关主页代码:

<p><a href="#register" data-role="button" data-rel="dialog" data-transition="pop">Register</a></p>

对话代码:

    <!-- Start of third page: #register -->
<div data-role="page" id="register">

    <div data-role="header" data-theme="e">

        <h1>Activation</h1>
    </div><!-- /header -->

    <div data-role="content" data-theme="d">    

        <h2>Licence Key</h2>
        <p>Please enter your licence key in order to activate your additional features of 20Keys</p>        

            <div data-demo-html="true">
                <div class="ui-field-contain">
                    <label for="licenseKey">Licence Key:</label>
                    <input type="text" name="licenseKey" id="key" placeholder="Insert Key" value="">
                </div>
            </div><!--/demo-html -->

    </div><!-- /content -->

    <div data-role="footer">

        <p><a href="#one" data-role="button" data-inline="true" data-icon="lock">Activate Now</a>   
        <a href="#one" data-role="button" data-inline="true" data-icon="cancel">Cancel</a></p>  
    </div><!-- /footer -->
</div><!-- /page register -->

目前激活按钮(正在进行中)只是回到主页。如果您发现任何可能导致此问题的内容,我将不胜感激您的评论。

当代码为时,页脚按钮也发生了同样的问题:

<p><a href="#one" data-rel="back" data-role="button" data-inline="true" data-icon="lock">Activate Now....</a>   
    <a href="#one" data-rel="back" data-role="button" data-inline="true" data-icon="cancel">Cancel</a></p>

我必须删除data-rel="back"才能解决这个问题。

如果这有助于回答这个问题,我正在使用 Chrome。先感谢您。

4

1 回答 1

0

我发现问题是什么...

您不能在对话框页面中使用 data-rel="back",因为从技术上讲,对话框页面没有可访问的后台页面,因为它会像新标签一样弹出。

解决我的问题的正确方法是仅使用 href="#one" 或可能使用 data-rel="close" 而不是 data-rel="back"。

于 2014-05-01T12:54:16.640 回答