How do I check which version of jQuery is loaded on the client machine? The client may have jQuery loaded but I don't know how to check it. If they have it loaded how do I check the version and the prefix such as:
$('.class') JQuery('.class')
You can just type window. jQuery in Console . If it return a function(e,n) ... Then it is confirmed that the jquery is loaded and working successfully.
You can use $. ui. version , it's actually the property jQuery UI looks for when determining if it should load itself (if it's already there, abort).
Because going jQuery free is generally better for performance and security - it is recommended to either not use jQuery, or use the latest version available. For older websites, it's not as simple. Removing jQuery can break existing old code on the website.
if (typeof jQuery != 'undefined') { // jQuery is loaded => print the version alert(jQuery.fn.jquery); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With