javascript TypeError: t(...).on 不是 fullcalendar 上的函数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29393568/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
TypeError: t(...).on is not a function on fullcalendar
提问by Mathias Maes
fullcalendar is throwing an error:
fullcalendar 抛出错误:
TypeError: t(...).on is not a function fullcalendar.min.js:8:11264
TypeError: t(...).on 不是函数 fullcalendar.min.js:8:11264
This are my script/css includes:
这是我的脚本/css 包括:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.3.1/fullcalendar.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<link href="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.3.1/fullcalendar.min.css" rel="stylesheet" type="text/css"/>
<link href="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.3.1/fullcalendar.print.css " rel="stylesheet" type="text/css"/>
And this is the page where I want to use fullcalendar:
这是我想使用 fullcalendar 的页面:
<script>
$(document).ready(function() {
// page is now ready, initialize the calendar...
$('#calendar').fullCalendar({
// put your options and callbacks here
})
});
</script>
Very basic, I just used the code from the documentation page. So my guess is that I've done something wrong with the tags.
非常基本,我只是使用了文档页面中的代码。所以我的猜测是我在标签上做错了。
Edit: I changed to use the non-minified version of fullcalendar. The error message changed to:
编辑:我改为使用 fullcalendar 的非缩小版本。错误信息改为:
TypeError: $(...).on is not a function fullcalendar.js:6912:2
类型错误:$(...).on 不是函数 fullcalendar.js:6912:2
When I click on that error it shows:
当我单击该错误时,它显示:
$(document).on('mousedown', this.documentMousedownProxy);
In the function:
在函数中:
bindGlobalHandlers: function() {
$(document).on('mousedown', this.documentMousedownProxy);
},
回答by Mathias Maes
The comment of Kevin B was the solution. I had to upgrade my jquery version.
凯文 B 的评论是解决方案。我不得不升级我的 jquery 版本。
I changed the jquery script to <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
and it works.
我将 jquery 脚本更改为<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
,它可以工作。