Let's say you have written some jQuery or a jQuery-plugin. Is there a way to check which (minimal) version of jQuery is required for the code to run?
Asked
Active
Viewed 315 times
4
-
Possible duplicate of http://stackoverflow.com/questions/1073423/jquery-plugin-check-version – Jay Blanchard Dec 20 '12 at 14:16
-
1it depends on the function you using if you are using function which in not in new version than you have to use older version list fo deprecated function http://api.jquery.com/category/deprecated/ **for example** As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. – NullPoiиteя Dec 20 '12 at 14:16
-
You can use feature detection to make sure a certain jQuery method is available for use. For example to check for jQuery 1.7+ you could check for `on()`: `var jq17 = typeof($().on) == "function"` – Rory McCrossan Dec 20 '12 at 14:18
-
@NullPointer was the only one who understood what I am asking. I want to parse a peace of code and the function should output something like "jQuery v1.4.3 is needed to run this code". – Sebastian Sebald Dec 23 '12 at 14:23
-
possible duplicate of [Measure jQuery plugin requirements](http://stackoverflow.com/questions/30537535/measure-jquery-plugin-requirements) – showdev May 29 '15 at 19:40