How to get jQuery-UI version?

This should be a simple question, but how to determine the version of jQuery-UI?

This is for the Greasemonkey script, and jQuery-UI, 1.5.2 appears on the landing page (current). But different landing pages may run different versions.

console.log ($.ui); didn't show anything useful / obvious for version detection.

+42
jquery jquery-ui greasemonkey
Sep 07 '10 at 10:51
source share
1 answer

You can use $.ui.version , in fact the jQuery user interface searches for when it should load itself (if it already exists, abort).

For example, here is a violin, including version 1.8.4 .

Unfortunately, $.ui.version was added in jQuery-UI version 1.6.

For earlier versions, you can check $.ui , though.

So, in this case, it may be enough:

 var version = $.ui ? $.ui.version || "pre 1.6" : 'jQuery-UI not detected'; 
+71
Sep 07 '10 at
source share



All Articles