I use jquery.unobtrusive and jquery.validate libraries in asp.net mvc 5 project to validate user registration on client side.
on browser I get this error:
Uncaught TypeError: $(...).parents(...).andSelf is not a function
at Object.parse (jquery.validate.unobtrusive.js:211)
at HTMLDocument.<anonymous> (jquery.validate.unobtrusive.js:392)
at mightThrow (jquery-3.1.1.js:3570)
at process (jquery-3.1.1.js:3638)
I use jquery 3.1.1 in my project.It seem to be versions problems.
Any idea how can I solve it?
Uncaught TypeError: $(...).parents(...).andSelf is not a function
"I use jquery 3.1.1 in my project."
The .andSelf()
method was removed from jQuery version 3
It was an alias for the .addBack()
method, which should be used instead.