javascript - TypeError : document. on is not a function

标签 javascript ruby-on-rails fullcalendar

这里是 ROR 新手。我正在尝试使用 FullCalendar在 Ubuntu 12 上使用 ROR 3.2.11。我下载了 working example并验证日历确实显示在示例应用程序中。但是,它不在我的应用程序中。我安装了 Firebug 看是否有任何 JavaScript 错误,有 2 个:

TypeError: document.on is not a function   <location rails.js:128>
TypeError: $(...).fullCalendar is not a function   <location calendar.js:48>

我不明白这些错误是什么意思。请记住,我没有编写这些 JavaScript,所以我不理解它们。

希望遇到此错误和解决方案的人可以提供帮助。

最佳答案

$(document).on() 是一个 jQuery 结构(参见 http://api.jquery.com/on/ )。 $(...).fullCalendar() 也闻起来像一个 jQuery 插件。在您的页面前面引用 jQuery(请参阅 https://developers.google.com/speed/libraries/devguide#jquery),它应该会亮起。

关于javascript - TypeError : document. on is not a function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14417049/

相关文章:

ruby-on-rails - Rails 应用程序上的轮询、网络套接字或 cometd

javascript - 未捕获的类型错误 : Undefined is not a function Issue in MVC C# using fullcalendar

javascript - 全日历选项不起作用

javascript - 如何使用js检查正则表达式中的日期验证?

javascript - JQuery 检查输入是否为空而不检查加载?

javascript - JSON 解析 Promise 行为不正常

ruby-on-rails - Rails Aptana 3 转到 Haml View 快捷方式

ruby-on-rails - {gem} at/path/to/local/git/repo 的本地覆盖正在使用分支开发,但 Gemfile 指定开发

jquery - 每天多列全日历

javascript - 当 'goog.structs' 存在时, 'goog.object' 的需求是什么?