【问题标题】:Problems with JQueryUI dialog in firefoxFirefox 中 JQueryUI 对话框的问题
【发布时间】:2011-06-23 01:15:43
【问题描述】:

大家好,我在 Firefox 中渲染 jquery 对话框时遇到问题。单击“获取表单”按钮时,应该打开/显示表单对话框。这适用于除 Firefox 之外的所有其他浏览器,其中对话框内容已经显示为正常形式。

这是在 Firefox 中的页面截图。 >>http://wyntersunholidays.com/screenshot.jpg

在 safari 中随心所欲地工作。 >>http://wyntersunholidays.com/Screen%20shot-safari.jpg

由于某种原因,该按钮未呈现为 jquery 按钮。有人可以帮助阐明这一点吗?

提前致谢

 $( "#dialog:ui-dialog" ).dialog( "destroy" );  
$( "#dialog-form" ).dialog({
        autoOpen: false,
        height: 450,
        width: 350,
        left:200,
        modal: true,
        buttons: {
            "Submit Details": function() {
                allFields.removeClass( "ui-state-error" );


                    $( "#users tbody" ).append( "<tr>" +
                        "<td>" + name.val() + "</td>" + 
                        "<td>" + email.val() + "</td>" + 
                        "<td>" + tel.val() + "</td>" +
                    "</tr>" ); 
                    $( this ).dialog( "close" );

            },
            Cancel: function() {
                $( this ).dialog( "close" );
            }
        },
        close: function() {
            allFields.val( "" ).removeClass( "ui-state-error" );
        }
    });

这就是我包含我的脚本的方式

<link href="css/learnercss.css" rel="stylesheet" type="text/css" />
<link href="jquery-ui-1/css/custom-theme/jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script src="jquery/jquery.cycle.lite.min.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script> 


<script>

$(document).ready(function() {

//the jquery...

})
</script>

【问题讨论】:

  • 听起来对话没有启动。请分享一些代码。
  • 我重新编辑了原始问题。它真的很奇怪,我花了几个小时试图弄清楚。

标签: jquery jquery-ui cross-browser


【解决方案1】:

该按钮也不会呈现为 UI 按钮,似乎 Firefox 不接受您在页面中包含 JavaScript 的方式。这就是我在页面中包含 jQuery 和 UI 的方式:

<head>
    ...
    <script src="jquery-1.5.1.min.js" type="text/javascript">
    <script src="jquery-ui-1.8.13.min.js" type="text/javascript">
    ...
</head>

如果仍然无法以这种方式工作,您能否发布如何包含它们?

【讨论】:

  • 原始问题已更新以显示我如何包含它们。
  • 和@Lawrence88:它可能与您的问题无关,但最好将它们放在&lt;body&gt; 元素的底部。 Here's why.
  • @Lawrence88:好的,这应该可以。正如你所怀疑的,我猜这个错误一定是在某些 JavaScript 中。您是否尝试过在运行 Firebug 的 Firefox 中访问您的页面?这应该会在控制台中给您一个错误。
  • 是的,谢谢大家。我下载并安装了 Firebug 和 firequery,并且能够调试和修复错误。
  • 解决方案是?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-27
相关资源
最近更新 更多