我正在使用此代码在对话框中显示图像。在运行代码时,我收到错误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");
}
});
});