在Jquery UI对话框中的空白按钮

时间:2011-01-04 18:07:09

标签: javascript jquery jquery-ui modal-dialog jquery-ui-dialog

我正在尝试使用jQuery UI创建一个弹出对话框表单,但生成的按钮中没有任何文本。

$(function(){
$( "#dialog-form" ).dialog({
        autoOpen: false,
        height: 300,
        width: 350,
        modal: true,
        resizable: false,
        buttons: {
            "OK": function() {
                alert("test");
                $( this ).dialog( "close" );
            }
        }
    });

生成按钮的代码是:

<div class="ui-dialog-buttonset">
 <button type="button" text="OK" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false">
   <span class="ui-button-text"/>
 </button>
</div>

此外,当页面加载时执行按钮处理程序的代码,这意味着当我加载页面时我看到“test”弹出窗口

我正在使用Google API加载的jQuery和jQuery UI

1 个答案:

答案 0 :(得分:0)

傻傻的我!我使用的是旧版本的jQuery(1.3.2),它应该与jQuery UI完全兼容,但我猜不是。谢谢!