我正在研究在MVC 5中创建的应用程序,我在按钮点击时使用bootstrap模式对话框。 我的主要内容区域加载了像这样的ajax
$(document).ready(function (e) {
$('a').click(function (event) {
var id = $(this).attr("id");
var URL = $(this).attr("title");
//$(this).css('background', '#d9edf7');
if (URL != '#') {
$('#dvContentArea').load(URL); //url is "/Controller/ActionMethod"
}
});
});
其中“dvContentArea”是在按钮点击时部分更新的div。 Bootstrap对话框第一次完美运行,但是当我点击链接并刷新#dvContentArea的html并再次单击按钮打开模态对话框时出现错误 “undefined不是一个函数”。