这里是 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/