-1

次のコードを使用して、mvc3 razor アプリケーションでポップを開きたいと考えています。ボタンをクリックしても何も起こりません。エラーコンソールに「 $(#dialog).dialog is not a function 」というエラーが表示されます。私は jquery を初めて使用します。誰かが私がやっている間違いを手伝ってくれますか?

 $(function () {   
        $('#dialog').dialog({
            autoOpen: false,
            width: 400,
            resizable: false,
            title: 'hi there',
            modal: true,
            open: function(event, ui) {
                //Load the Edit action which will return 
                // the partial view _Edit
                $(this).load("@Url.Action("Edit")");
            },
            buttons: {
                "Close": function () {
                    $(this).dialog("close");
                }
            }
        });

        $('#Button1').click(function () {
            $('#dialog').dialog('open');
        });
    });  
4

1 に答える 1

3

使用.dialogするには、ページに jQuery と jQueryUI をロードする必要があります。

これをあなたに追加してくださいHEAD

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
于 2012-05-21T10:06:20.703 に答える