JQuery UI对话框 - 加载外部页面可防止重新打开对话框

时间:2012-08-28 21:08:08

标签: ruby-on-rails jquery-ui

如果我在不加载外部内容的情况下加载JQuery UI对话框,则可以使用“关闭”按钮关闭对话框,并且可以多次重新打开对话框。如果我加载内容,这两个功能都不起作用。代码如下。任何提示?在此先感谢!!

        $(document).ready(function() {
           $('#viewdonationsdialog').dialog({
             autoOpen:false,
             modal:'true',
             width:600,
             height:400,
             buttons: {
                Close: function() {
                    $( this ).dialog( "close" );
                }
             }
          });
         $('#viewdonationslink').click(openDonationsDialog);            
        });

        var openDonationsDialog = function(){
/* Including the next line causes failure.  
Removing it results in success (except, of course, that my page content isn't loaded!! */

            $('#viewdonationsdialog').load('/donationsdata');       

/* And then there's the rest... */

            $('#viewdonationsdialog').dialog('open');
            return false;
        };

0 个答案:

没有答案