New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model binding breaks when using jQuery <1.7 #2199
Comments
I dunno if I agree with adding support for jQuery < 1.7. That version is already over 4 years old (as you mentioned). Since there are very few BC breaks between 1.6 and 1.7, it should be reasonable to upgrade the jQuery version in any project using VueJS (or, just go without jQuery at all, if that's possible). |
I encountered this scenario the other day when I was tasked to introduce a new feature into an existing legacy system. That legacy system was working with jQuery 1.5.x, and it was dependent on @young-steveo mentions that you should go without jQuery completely if it's possible. As described in my situation, it was beyond my control. I'm not necessarily advocating that Vue should support legacy versions of jQuery, but since Vue works just fine without jQuery, I feel that it should fail gracefully if jQuery exists and |
@rjv Ah, so you're saying it should just not use jQuery if |
If jQuery is being used on the same page as Vue, it appears that Vue has a dependency on jQuery 1.7 or above. The reason for the dependency is illustrated here (from the Vue source http://vuejs.org/js/vue.js):
This code makes the assumption that if jQuery is available, then the jQuery.on method is also available. According to the jQuery API, this method was first introduced in 1.7 (http://api.jquery.com/on/).
Here's an example of the scenario I'm describing: https://jsbin.com/darawa/edit?html,js,console,output
You can see that we get an error because we're using jQuery 1.6.4.
I'm not sure if it's reasonable to make the assumption that the included jQuery has the
on
method available (e.g. they're using 1.7 or newer). I realize 1.7 is quite old, but at the very least I think we could handle this scenario more gracefully.The text was updated successfully, but these errors were encountered: