0

我收到错误“错误:在初始化之前无法调用对话框上的方法;试图调用方法'destroy'”。使用的脚本如下所示,我使用的是 jquery-ui-1.10.3.js

<script type="text/javascript">
        $(function () {
            $('a.dialog').live("click", function (event) {
                loadDialog(this, event, '#contentGrid');
            });
        });
        function loadDialog(tag, event, target) {
            event.preventDefault();
            var $url = $(tag).attr('href');
            var $title = $(tag).attr('title');
            var $dialog = $('<div></div>');
            $dialog.empty();
             $(this).dialog('destroy').remove();
            $dialog
            .load($url)
            .dialog({
                autoOpen: false
                , title: 'Skill Request'
                , width: 500
                , modal: true
                , minHeight: 300
                , show: 'slide'
                , hide: 'scale'
            });
            $dialog.dialog('open');
        };
    </script>
4

0 回答 0