I have a project which uses many plugins. However, some are reliant on older versions of JQuery . The plugin I intend to use is dependent on JQuery 1.7 as it uses ‘on’ for event binding.
How can I modify the plugin so that it will work with JQuery 1.6? If I upgrade to JQuery 1.7 it will break other parts of my project that are dependant on the plugins. Or is there a better way to deal with this scenario?
Well you have to look at each call to be sure, but you can easily replace
on()calls withdelegate()(expecially whenon()is used for newly added elementsbasically you have to switch the first two arguments. Otherwise you could load jQuery 1.7 just for the plugin and use
$.noConflict(true)