TypeError: this.element.prop is not a function

I was upgrading jquery and jquery-ui references in one of my project to the latest versions. Things were working fine on all of the pages except one where I kept getting this error:

TypeError: this.element.prop is not a function

I looked in every place possible but couldn’t get it why I was getting that error. After debugging for sometime with firebug, I saw a file jquery version 1.5.2 was included in the page.

Ahhh…now it struck me that I had a custom control that I created long time back which would emit jquery file as an embedded resource.

Luckily, while I created that control, I had exposed a property to let the control know if to include the jquery file or not. Default is true.

So I set the property to false and the error went away.

I should have known that instantly, because .prop()was introduced after 1.5.2 ( I believe starting 1.6) but sometimes easiest thing doesn’t strike easily.

So if you get this error, check somewhere you will have a hidden reference to older version of jquery.

Hope this helps.

No Comments