DEV Community

MoreOnFew
MoreOnFew

Posted on • Originally published at moreonfew.com on

1

How to check jQuery version?

Many of us might have come across scenarios wherein we wanted to do something based on the version of the jQuery loaded. To be specific I’m talking about scenarios where one might want to know the version of jQuery programmatically and if the version was say 1.3.2 then load some other files too or do something else. Well, I must say that it is a very easy process to identify jQuery’s version , Let’s take a look at how to do it.

You can get to know the version of jQuery loaded by using the following:

alert("jquery version = "+ $.fn.jquery);

//or 

alert("jquery version = "+ jQuery.fn.jquery);

//or 

alert("jquery version = "+ $().jquery);
Enter fullscreen mode Exit fullscreen mode

How to check jQuery version in console?

Checking the version of jQuery through the console of firebug or any other browser-based console is also very easy. You can do it by typing the same code mentioned above in the console.

For e.g :

Go to console and type

$().jquery

//Or

$.fn.jquery

//Or

jQuery.fn.jquery
Enter fullscreen mode Exit fullscreen mode

All of the above codes would give you the same result.

How to detect / get jQuery UI version?

Detecting or Checking jQuery UI’s version is also quite simple. However, there was a slight change after version 1.6 was released. Let’s take a look at the code :

/*Use this to check the version number in jQuery UI version 1.6 onwards*/
var jqueryUI_version = $.ui.version;

/*Use this to check the version number in jQuery UI prior to version 1.6*/
var jqueryUI_version = $.ui;
Enter fullscreen mode Exit fullscreen mode

So go ahead and share your experience with other readers here. Also do tweet or share this post with your friends.

The post How to check jQuery version? first appeared on MoreOnFew.

SurveyJS custom survey software

Build Your Own Forms without Manual Coding

SurveyJS UI libraries let you build a JSON-based form management system that integrates with any backend, giving you full control over your data with no user limits. Includes support for custom question types, skip logic, an integrated CSS editor, PDF export, real-time analytics, and more.

Learn more

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay