Tag ‘parentNode’ » Archiv


5

this.parentNode has no properties jQuery

November
13

Ever had this error when you’re running a jQuery script?

this.parentNode has no properties jQuery

This innocuous error, in my experience comes down to two things:

  1. You are trying to get the ID of a parent object. Like if you want the form ID from knowing the name field. jQuery(“#name”).parents(“form”).attr(“id”); and the form doesn’t have the attribute of ID set.
  2. Scriptaculous , more specifically effects.js . If the effects.js is being used on the same page then this error happens. The solution is to download the latest version (1.8.1) and use that instead. You can overwrite just the effects.js from the package and you wont get the error any more!

Exciting? yes because no matter how many searches I made I couldn’t find the answer. Google groups and forums all talked about something else causing it like noConflict() or loading scriptaculous first.

Now you know. Use the latest version of Scriptaculous (if you must use it at all) with jQuery.

Blog News, Code, ajax