JQuery Detection

Developer
Size
2,576 Kb
Views
46,552

How do I make an jquery detection?

What is a jquery detection? How do you make a jquery detection? This script and codes were developed by Ariel Flesler on 28 July 2022, Thursday.

JQuery Detection Previews

JQuery Detection - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>jQuery Detection</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Detect jQuery version and plugins on the page <i>by <a href="https://twitter.com/flesler" target="_blank">Ariel Flesler</a></i></h1>
<div id="output"> <p>Here's the bookmarklet, <b>drag this link</b> to your <b>bookmark bar</b> and you are all set</p>
<a id="link" href="javascript:(function(a){function f(d,a){var b=document.createElement('script');b.type='text/javascript';b.src=d;b.onload=a;b.onerror=function(){alert('Could not load '+d)};document.documentElement.lastChild.appendChild(b)}function g(){var d=[''];h(d,a,jQuery);h(d,a.fn,jQuery.fn);window.$=jQuery=a;alert('Found jQuery '+k+(c?' and UI '+c:'')+'\nPlugins:'+d.sort().join('\n * '))}function h(a,c,b){for(var e in c)'_'===e.charAt(0)||b[e]||'function'!==typeof c[e]||-1!==a.indexOf(e)||a.push(e)}if(!a)return alert('jQuery not included'); var k=a.fn.jquery,c;f('https://code.jquery.com/jquery-'+k+'.min.js',function(){a.ui?(c=a.ui.version,f('https://code.jquery.com/ui/'+c+'/jquery-ui.min.js',g)):g()})})(window.jQuery);">Detect jQuery 1.0.1</a> <div>I'm working on improving it on <a href="https://github.com/flesler/jquery.detect" target="_blank">this Github repo</a>, if you have any doubt or suggestion, ping me on <a href="https://twitter.com/flesler" target="_blank">Twitter</a> or <a href="https://github.com/flesler/jquery.detect/issues" target="_blank">Github</a><br /> Here's the source version of the code in case you want to see it. <pre>/** * Detect jQuery version and plugins on the page * Copyright (c) 2013 Ariel Flesler - aflesler[a]gmail[d]com * @author Ariel Flesler * @version 1.0.1 */
javascript:(function($){ if (!$) return alert('jQuery not included'); function load(url, success) { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.onload = success; script.onerror = function(){ alert('Could not load '+url); }; document.documentElement.lastChild.appendChild(script); } var jQv = $.fn.jquery, UIv; load('https://code.jquery.com/jquery-'+jQv+'.min.js', function() { if ($.ui) { UIv = $.ui.version; load('https://code.jquery.com/ui/'+UIv+'/jquery-ui.min.js', check); } else { check(); } }); function check() { var plugins = ['']; compare(plugins, $, jQuery); compare(plugins, $.fn, jQuery.fn); window.$ = jQuery = $; alert('Found jQuery '+ jQv + (UIv ? ' and UI '+UIv : '') +'\nPlugins:'+plugins.sort().join('\n * ')); } function compare(list, lib, base) { for (var key in lib) { if (key.charAt(0) !== '_' && !base[key] && typeof lib[key] === 'function' && list.indexOf(key) === -1) { list.push(key); } } }
})(window.jQuery);</pre> </div>
</div>
</body>
</html>

JQuery Detection - Script Codes CSS Codes

#link { display: block; margin:20px 0 30px; border:1px solid #AAA; background:#DDD; width:135px; padding:10px; }
pre { background:#EEE; border:1px solid #AAA; width:850px; padding:10px; overflow:hidden; }
i { font-size:16px; }
JQuery Detection - Script Codes
JQuery Detection - Script Codes
Home Page Home
Developer Ariel Flesler
Username flesler
Uploaded July 28, 2022
Rating 3
Size 2,576 Kb
Views 46,552
Do you need developer help for JQuery Detection?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Ariel Flesler (flesler) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!