TypeError: document.on is not a function

ROR newbie here. I am trying to use FullCalendar with ROR 3.2.11 on Ubuntu 12. I downloaded a working example and confirmed that the calendar metric is displayed in the sample application. However, this is not in my application. I installed Firebug to see if there are 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 that I didn't write these Java scripts, so I don't understand them.

Hope someone ran into this error and a solution can help.

+3


source to share


2 answers


$(document).on()

is a jQuery construct (see http://api.jquery.com/on/ ). $(...).fullCalendar()

also smells like a jQuery plugin. The jQuery link is earlier in your page (see https://developers.google.com/speed/libraries/devguide#jquery ) and it should light up.



+2


source


Check your jquery version, it must be at least 1.7 for $ (document) .on () to work.



0


source







All Articles