1

Suddenly after we added some new code/features.. we get this error:

Uncaught TypeError: $(...).on is not a function

Our code is clean and works as a stand-alone html/js/css project.

We tried upgrading to the latest jQuery vrsn : jquery-1.11.0.min.js and we're still getting this error. GRR!

What else can we do to troubleshoot this?

Running: Drupal v7

thanks so much!

Community
  • 1
  • 1
Arturino
  • 358
  • 7
  • 19
  • what was your previous jQuery version. If it was below `1.9.0` then you should check whether you are loading `JQuery Migrate Plugin` plugin along with `jQuery 1.11.0` – vijayP Oct 15 '15 at 13:43
  • Please check this below url, it will help you to fix the issue. http://drupal.stackexchange.com/questions/129952/jquery-on-method-returns-undefined-is-not-a-function – Aryashree Pritikrishna Jan 25 '16 at 06:11
  • For me, it was because my Adminimal theme was using jQuery Update, but that particular theme was set to Drupal's default jQuery version (1.4). Setting the theme to 1.10 fixed it for me. – tyler.frankenstein Mar 28 '16 at 16:14

2 Answers2

1

After a closer inspection we found 2 vrsns of jquery running. http://screencast.com/t/2qr2Cv09oWP * we inherited this project.

Solution was this: https://www.drupal.org/project/jquery_update

Arturino
  • 358
  • 7
  • 19
0
  1. you should download and setup jquery_update module on drupal.
  2. you should run your function reverting the $ alias
  3. pay attention to the way you insert code in drupal_add_js function

update: as I can read from the error description you already followed the second point.

morels
  • 2,095
  • 17
  • 24