Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: document.on is not a function

ROR newbie here. I am attempting to use FullCalendar with ROR 3.2.11 on Ubuntu 12. I've downloaded a working example and verified the calender does display in the sample app. However, it does not in my app. I installed Firebug to see if there are any JavaScript errors and there are 2:

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

I don't understand what the errors mean. Keep in mind I did not write these JavaScripts, so I don't understand them.

Hoping someone who has come across this error and solution can help.

like image 820
Lenny B. Avatar asked Oct 29 '25 08:10

Lenny B.


1 Answers

$(document).on() is a jQuery construct (see http://api.jquery.com/on/). $(...).fullCalendar() also smells like a jQuery plugin. Reference jQuery earlier in your page (see https://developers.google.com/speed/libraries/devguide#jquery) and it should light up.

like image 98
robrich Avatar answered Oct 31 '25 20:10

robrich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!