Edit D:\xinhaisoft\crisis_new\Scripts\jquery.selectcache.js
/* * ????????? * ?????(QQ33080907) * ????????2020.12.03 * ?????????????????????????????????? */ (function ($) { $.fn.selectcache = function (options) { var defaults = { server: '', index: false, tree: false, cache: true, chosen: true, notop: false, delay: 0 } var opts = $.extend(defaults, options) var $this = $(this) if ($this.length === 0) { return } else if ($this.length > 1) { alert('jquery.selectcache.js: the DOM\'s length > 1') } else if ($this.prop('tagName').toLowerCase() !== 'select') { alert('jquery.selectcache.js: only bind to select') } else if (!opts.url) { alert('jquery.selectcache.js: missing options (url)') } else { var deferreds = [] setTimeout(function () { if (typeof store === 'undefined') { deferreds.push($.ajax('/Scripts/store2.min.js', { dataType: 'script', cache: true })) } if (opts.tree && typeof ($.fn.jTreeSelect) !== 'function') { deferreds.push($.ajax('/Scripts/jquery.jtree.js', { dataType: 'script', cache: true })) } if (opts.server === '' && typeof Global === 'undefined') { deferreds.push($.ajax('/Scripts/global.js', { dataType: 'script', cache: true })) } $.when.apply(null, deferreds).done(function () { var key = 'selectcache-' + opts.url.substring(1).replace(/\/|\?|=|&/g, '-') var list = store(key) if (opts.cache && list && list.length) { makeselect(list) } else { $.getJSON((opts.server || Global.Host) + opts.url, function (json) { if (json.code !== 0) { alert(json.message) } else { list = json.data makeselect(list) store(key, list) } }) } }) }, opts.delay * 1000) } return this // ????????? function makeselect(list) { var value = $this.data('value') var html = '' if (opts.tree) { $.each(list, function (i, item) { html += '<option value="' + item.id + '"' + (item.id === value ? ' selected' : '') + ' data-pid="' + item.parid + '">' + item.name + '</option>' }) $this.append(html).jTreeSelect() if (opts.notop) { $this.children().first().remove() } } else { $.each(list, function (i, item) { html += '<option value="' + item.id + '"' + (item.id === value ? ' selected' : '') + '>' + (opts.index ? (i + 1) + '. ' : '') + item.name + '</option>' }) $this.append(html) } if (opts.chosen && typeof ($.fn.chosen) === 'function') { $this.width(function (i, w) { return w + 12 }).chosen({ disable_search_threshold: 10, no_results_text: '???????????', search_contains: true, placeholder_text_multiple: '???[Ctrl]?????????????????????' }) } } } })(jQuery)
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de