Fullcalendar v2.6.0 能否在 jQuery-3.3.1 和 MVC 5 上运行?我有一个需要升级的旧项目。我正在使用带有 jQuery-3.3.1、MVC 5.2.4 和 moment.min.js 2.24 的 Visual Studio 2017 来重新编译它,但是当我使用 IE 11 时总是出错:
http://localhost:61158/Scripts/jquery-3.3.1.js 0x800a138f中的第 3827 行第 3 列未处理的异常 - JavaScript 运行时错误:无法获取未定义或空引用的属性“格式”
当我使用谷歌浏览器调试它时,我收到一条错误消息:
未捕获的类型错误:无法读取 null 的属性“格式”
有人有什么想法吗?谢谢。
抱歉,这是我在 index.cshtml 中的日历代码。
<script type="text/javascript">
$(document).ready(function() {
$('#calendar').fullCalendar({
theme: true,
aspectRatio: 2,
defaultDate: '@DateTime.Now.ToString("MM-dd-yyyy")',
editable: true,
eventLimit: true, // allow "more" link when too many events
events: {
url: '@Url.Action("GetCalendarEvents")',
error: function () {
$('#script-warning').show();
}
},
eventClick: function (calEvent, jsEvent, view) {
//set the values and open the modal
//var winWidth = $(window).width();
//var dialogWidth = winWidth * 0.5;
var gdiv = $("#eventInfo");
if (gdiv != null) gdiv.empty();
$.ajaxSetup({ cache: false });
var request = $.ajax({
type: "GET",
url: calEvent.ajaxUrl,
data: {}
});
request.done(function (returndata) {
$("#eventInfo").html(returndata);
});
request.fail(function (jqXHR, status) {
alert("Error repopulating grid : " + status + "");
});
$.ajaxSetup({ cache: true });
}
});
});
</script>