I faced this error while using jQuery 1.10.

This is due to the method live which has been marked as deprecated since jQuery 1.7 and removed in 1.9.
We are now suppose to use on which is backward compatible until 1.7

see jQuery live doc

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

theo_’s picture

Here is a tiny patch to replace live with on method

dragon658’s picture

Subscribe. (I also have this problem)

srobert72’s picture

mglaman’s picture

Status: Active » Needs review

Has patch, marking needs review.

mwilliams77’s picture

Here is an updated patch, replacing "live" with "on"

BenR’s picture

Status: Needs review » Reviewed & tested by the community

Worked for me. #2159009: Uncaught TypeError: Object has no method 'live' commerce_add_to_cart_confirmation.js:9 has very similar patch. This issue is older and I closed the other one.

mglaman’s picture

Status: Reviewed & tested by the community » Needs work

Drupal 7 includes jQuery 1.4.4 and jQuery UI 1.8.7. The .on method was added in 1.7.

BenR’s picture

Status: Needs work » Needs review
FileSize
691 bytes

Sorry, missed that. Seems like we will have to use .delegate.

slashrsm’s picture

Majority of sites use versions of jQuery that are newer than those mentioned in #7. .on() seem a good solution as it does the job and is widely supported across different versions.

mglaman’s picture

Majority of sites use versions of jQuery

I generally don't use jquery_update in my sites. I'm just saying we need a stub, at least. One that checks if the newer function exists.

betarobot’s picture

#8 worked fine for me too with Bootstrap based theme (which requires jQ update).

GoZ’s picture

Status: Needs review » Needs work

#8 Works fine for me too with jquery update and jquery 1.10.
We should use each methods depending of jquery version. So people doesn't using jquery_update will use live() (available for Drupal7 included jquery) and on() will be used for people with jquery >= 1.9

BenR’s picture

delegate() (used in #8) was added in 1.4.2 and works for both.

gsbc’s picture

There was a similar issue with Kickstart ( #2106687: Commerce search error with newer jquery versions (above 1.9)) and it was decided that it was better to use bind because while it just calls on for newer versions, it's also compatible with older versions, so it works out of the box whether jquery_update is used or not.

Here's a suggested patch using bind.

gsbc’s picture

Status: Needs work » Needs review
dimmech’s picture

Patch in #14 worked fine... using jQuery update and version 1.10.

deggertsen’s picture

Status: Needs review » Reviewed & tested by the community

Works great.

  • deggertsen committed b11088a on 7.x-1.x authored by gsbc
    Issue #2159009 by gsbc: Uncaught TypeError: Object has no method '\''...
deggertsen’s picture

Status: Reviewed & tested by the community » Fixed

Committed to dev. Please comment if there are any issues.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.