jquery createdialog undefined错误

时间:2013-12-31 05:09:31

标签: jquery

我正在使用此代码在对话框中显示图像。在运行代码时,我收到错误id is undefined and Microsoft JScript runtime error: 'createdialog' is undefined

 $(function () {
    debugger;
    $("#dialog").dialog({
        modal:true,
        autoOpen: false,
        resizable: false,
        width: "auto"
    });

    var id= $(this).attr('@Model.Id')
    $(function createdialog(id)
        {         

        $("#dialog").html("<img src='" + $(this).next().find('id').attr("src") + "' width='250' +  height='300'>");
        $("#dialog").dialog("option", "position", {
               modal:"true",
                my: "center",
                at: "center",
                of: window
            });
        if ($("#dialog").dialog("isOpen") == false) {
            $("#dialog").dialog("open");
            }
        });
    });

0 个答案:

没有答案