How do I know if a site is running JQuery for its effects?

Question

How do I know if a site is running JQuery for its effects?

Answer

Even though many modern sites have moved to use other libraries for their user interfaces, like React, there are still websites that rely on JQuery for their JavaScript interaction and effects, so the way to check which ones do have it is using the browser’s inspector console (Chrome & Firefox) which with Mac computers we can access with the shortcut command+option+j in Windows you will get it with Control+Shift+j, for Safari we need to go to preferences/advance and check show develop menu in menu bar, then we can access it with command+option+i (Mac), and control+shift+i (Windows), once we see something like so:

We will notice that is an actual command line, to check for JQuery we can use console.log:

console.log(jQuery)

If JQuery exists in the site it will return a function once we press enter, like so:

ƒ (a,b){return new m.fn.init(a,b)}

otherwise, it will return an error that mentions *JQuery is not defined:

51%20PM

If we wanted to know which version it is running, we can also check for that once we know it has JQuery.
Let’s remember that JQuery’s library is ultimately loaded as a function, but it is storing its version that we can check for with:

console.log(jQuery.fn.jquery)

the return will be a number version. Ie.: 1.11.2

Now, we can check which sites run this fun library.

9 Likes

Wappalyzer, an extension for Chrome, is also a great tool to see the lenguages, libraries and frameworks used in the site you are visiting.

9 Likes

That’s a bit of an understatement :slight_smile: jQuery is still used in 96% of websites that use JavaScript, and React only 3% (jQuery vs. React usage statistics, November 2023). Sure, React is growing in popularity, but 200% growth for React means it went from 1% to 3% of the market share.

3 Likes