繁体   English   中英

fullcalendar.js:未捕获TypeError:无法读取未定义的属性'ownerDocument'

[英]fullcalendar.js: Uncaught TypeError: Cannot read property 'ownerDocument' of undefined

我使用fullcalendar.js和scheduler.js插件在客户的ASP.NET WebForms站点上实现了一个调度程序。 它在我的本地机器上工作就像一个魅力,但当我将它部署到另一个 - 客户或我的 - 它抛出一个通用的“无法读取属性'ownerDocument'未定义”错误。

这是一个堆栈跟踪:

getScrollParent (fullcalendar.js:302)
queryBoundingRect (fullcalendar.js:2419)
build (fullcalendar.js:2236)
d.internalApiVersion.r.prepareHits (scheduler.min.js:8)
computeCoords (fullcalendar.js:3066)
handleInteractionStart (fullcalendar.js:3025)
startInteraction (fullcalendar.js:2520)
dayMousedown (fullcalendar.js:3656)
(anonymous function) (fullcalendar.js:3597)
dispatch (jquery.min.js:3)
q.handle (jquery.min.js:3)

这是抛出错误的一行:

返回位置==='固定'|| !scrollParent.length? $(el [0] .ownerDocument || document):scrollParent;

到目前为止我做过的事情:

  1. 检查两个系统上的文件 - 所有文件完全相同
  2. 将fullcalendar更新到版本3(通过用新的替换2.9.1文件)
  3. 在IISExpress和IIS上运行它
  4. 使用fullcalendar的非缩小版本。

结果是上面的错误。

这是我正在尝试处理的事件:

            select: function(start, end, jsEvent, view, resource) {

            $.ajax({
                url: '/WebServices/WineLocationTaskService.asmx/GetUsersByWineLocation',
                type: 'POST',
                contentType: 'application/json; charset=utf-8',
                datatype: 'json',
                data: JSON.stringify({
                    locationID: '<%= App.Context.Data.Location.ParentLocation %>'
                }),

                success: function(data) {

                    var json = $.parseJSON(data.d);
                    var users = [];
                    $.each(json, function(i, field) {

                        //var option = $('<option value="' + field.id + '">' + field.name + '</option>');
                        //$('#users').append(option);
                        users.push({
                            id: field.id,
                            text: field.name
                        });
                    });

                    $('#users').select2({ data: users, multiple: true, width: "100%" });
                },
                error: function() {
                    alert('there was an error while fetching events!');
                }
            });
            $("#startDate").text(start.format());
            $("#endDate").text(end.format());
            $("#resourceID").val(resource.id);

            $("#dialog2").dialog('open');
        },

在后端,我用代码200的结果调用ASMX服务 - 我可以看到响应数据是有效的json。

这可能是可能的不同IIS模块处理程序设置的结果吗? 我在工作站点和非工作站点上使用完全相同的web.confing。

body .fc {
  overflow:auto;
}

在github上添加这个发现

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM