The jQuery replacement for select boxes
当前为
// ==UserScript==
// @name Select2
// @namespace https://select2.github.io/
// @version 0.2
// @description The jQuery replacement for select boxes
// @author t_liang
// @include *:*
// @grant none
// ==/UserScript==
(function() {
var jQueryOnload = function() {
jQuery(function($) {
$.getScript('//cdn.bootcss.com/select2/4.0.3/js/select2.min.js', function() {
$('select', document.body).select2();
});
$(document.head).append('<link href="//cdn.bootcss.com/select2/4.0.3/css/select2.min.css" rel="stylesheet">');
});
};
if (typeof jQuery == 'function') {
jQueryOnload();
} else {
var jQueryScript = document.createElement('SCRIPT');
jQueryScript.src = '//cdn.bootcss.com/jquery/3.1.1/jquery.min.js';
jQueryScript.onload = jQueryOnload;
document.head.appendChild(jQueryScript);
}
})();