前言:JS输入框模糊匹配插件以前在工作写过一个类似的 所以这次写轻松很多,这次写优化了几个方面:

1. 添加动态加载css文件 不需要引入css css全部在JS动态生成。

2. 不需要额外的标签 只需要一个input输入框 并且默认指定一个class类名为 "inputElem" 当然也可以自己配置参数 还需要一个当前父级容器增加一个默认类名 parentCls(也可以自己配置),因为输入框匹配值后需要一个隐藏域 所以需要隐藏域增加一个class "hiddenCls" 当然也支持自己配置参数。

如下代码:

<div class="parentCls">
<div style="width:200px;height:26px;border:1px solid #ccc;">
<input type="text" class="inputElem" style="width:200px;height:26px;line-height:26px;"/>
</div>
<input type="hidden" class="hiddenCls"/>
</div> <div class="parentCls">
<div style="width:200px;height:26px;border:1px solid #ccc;">
<input type="text" class="inputElem" style="width:200px;height:26px;line-height:26px;"/>
</div>
<input type="hidden" class="hiddenCls"/>
</div>

3. 支持页面上有多个输入框。

4. 支持鼠标点击和 键盘 上移和下移键操作 类似于百度输入框。

页面上所有的标签都是动态的生成的,不需要额外的标签。如上面的 只需要input标签 其他的div标签不依赖 只需要父级元素增加class "parentCls"(当然可以自己配置类名),

及要传给后台开发人员的隐藏域输入框 增加一个class "hiddenCls" 当然也可以自动配置参数。

我的模糊查询匹配的需求是这样的:

 1. 每keyup时候 点击或者键盘上移下移操作 输入框填充用户名/工号 隐藏域填充工号 发请求 服务器返回数据 渲染出来。当然 隐藏域填充工号 值是form表单提交时候 后台要拿到提交过来的工号 所以需要这么一个隐藏域。

2. 当用户直接在输入框输入值时候 并没有键盘上移下移 或者 点击下拉框某一项时候 当鼠标失去焦点时候(blur) 当前输入框值为空 隐藏域值为空,这样做的目的 是为了防止上次form提交过后的数据仍然保存在隐藏域里面 当用户重新输入的时候 用户也并没有操作键盘上下移操作或者点击操作 再点击提交按钮时(失去焦点),那么值为空 隐藏域值为空 这样防止搜索出来不是用户输入的那个东东。

3. 当用户点击某一项时候 或者 上移下移时候 输入框动态的生成值 且输入框值现在不能重新输入 只有当点击输入框x的时候 才可以重新输入。

4. 已经遗留输入框可以多选的接口 目前还未完善输入框多选的操作。

5. 禁止ctrl+v 或者右键 粘贴操作。

下面我们来具体看看效果图是个什么样的吧 如下图所示:

下面HTML代码如下:

<div class="parentCls">
<div style="width:200px;height:26px;border:1px solid #ccc;">
<input type="text" class="inputElem" style="width:200px;height:26px;line-height:26px;"/>
</div>
<input type="hidden" class="hiddenCls"/>
</div> <div class="parentCls">
<div style="width:200px;height:26px;border:1px solid #ccc;">
<input type="text" class="inputElem" style="width:200px;height:26px;line-height:26px;"/>
</div>
<input type="hidden" class="hiddenCls"/>
</div> <input type="button" value="提交"/>

JS代码如下:

 /**
* JS 模糊查询
* @author tugenhua
* @date 2013-11-19
* @param 1.当前的input add targetCls
* 2. 隐藏域里面统一增加同类名 叫 hiddenCls
* 3. 在各个父级元素上 添加类名 parentCls
*/ function AutoComplete (options) {
this.config = {
targetCls : '.inputElem', // 输入框目标元素
parentCls : '.parentCls', // 父级类
hiddenCls : '.hiddenCls', // 隐藏域input
searchForm :'.jqtransformdone', //form表单
hoverBg : 'hoverBg', // 鼠标移上去的背景
outBg : 'outBg', // 鼠标移下拉的背景
isSelectHide : true, // 点击下拉框 是否隐藏
url : '', // url接口
height : 0, // 默认为0 不设置的话 那么高度自适应
manySelect : false, // 输入框是否多选 默认false 单选
renderHTMLCallback : null, // keyup时 渲染数据后的回调函数
callback : null, // 点击某一项 提供回调
closedCallback : null // 点击输入框某一项x按钮时 回调函数
}; this.cache = {
currentIndex : -1,
oldIndex : -1,
inputArrs : [] // 多选时候 输入框值放到数组里面去
};
this.init(options);
} AutoComplete.prototype = { constructor: AutoComplete,
init: function(options) { this.config = $.extend(this.config, options || {});
var self = this,
_config = self.config,
_cache = self.cache; // 鼠标点击输入框时候
$(_config.targetCls).each(function(index,item) { // 点击搜索回来后判断 隐藏域有没有值 $(item).click(function(){
var callVal = $.trim($(this).val()),
curP = $(this).closest(_config.parentCls),
hiddenVal = $.trim($(_config.hiddenCls,curP).val()),
targetParent = $(this).parent();
if(callVal != '' && hiddenVal != '') {
self._createDiv(targetParent,callVal);
!$(this).hasClass('hidden') && $(this).addClass('hidden');
self._hover();
self._closed();
}
}); /*
* 禁止 ctrl+v 和 黏贴事件
*/
$(item).unbind('paste');
$(item).bind('paste',function(e){
e.preventDefault();
var target = e.target,
targetParent = $(target).closest(_config.parentCls);
$(this).val('');
$(_config.hiddenCls,targetParent) && $(_config.hiddenCls,targetParent).val('');
}); $(item).keyup(function(e){
_cache.inputArrs = [];
var targetVal = $.trim($(this).val()),
keyCode = e.keyCode,
elemHeight = $(this).outerHeight(),
elemWidth = $(this).outerWidth(); // 如果输入框值为空的话 那么隐藏域的value清空掉
if(targetVal == '') {
var curParents = $(this).closest(_config.parentCls);
$(_config.hiddenCls,curParents).val('');
}
var targetParent = $(this).parent();
$(targetParent).css({'position':'relative'}); if($('.auto-tips',targetParent).length == 0) {
// 初始化时候 动态创建下拉框容器
$(targetParent).append($('<div class="auto-tips hidden"></div>'));
$('.auto-tips',targetParent).css({'position':'absolute','top':elemHeight,'left':'0px','z-index':999,'width':elemWidth,'border':'1px solid #ccc','overflow':'hidden'});
} var curIndex = self._keyCode(keyCode);
if(curIndex > -1){
self._keyUpAndDown(targetVal,e,targetParent);
}else {
var isHasClass = _config.targetCls.replace(/^\./,''); if(targetVal != '' && $(this).hasClass(isHasClass)) {
self._doPostAction(targetVal,targetParent);
} }
}); // 失去焦点时 如果没有点击 或者上下移时候 直接输入 那么当前输入框值情况 隐藏域值情况
$(item).blur(function(e){
var target = e.target,
targetParent = $(target).closest(_config.parentCls),
hiddenVal = $(_config.hiddenCls,targetParent).val(); if($(this).attr('up') || $(this).attr('down') || hiddenVal != '') {
return;
}else {
$(this).val('');
$(_config.hiddenCls,targetParent).val('');
}
});
}); // 阻止form表单默认enter键提交
$(_config.searchForm).each(function(index,item) {
$(item).keydown(function(e){
var keyCode = e.keyCode;
if(keyCode == 13) {
return false;
}
});
}); // 点击文档
$(document).click(function(e){
e.stopPropagation();
var target = e.target,
tagParent = $(target).parent(),
attr = $(target,tagParent).closest('.auto-tips'); var tagCls = _config.targetCls.replace(/^\./,''); if(attr.length > 0 || $(target,tagParent).hasClass(tagCls)) {
return;
}else {
$('.auto-tips').each(function(index,item){
!$(item,tagParent).hasClass('hidden') && $(item,tagParent).addClass('hidden');
}); }
}); var stylesheet = '.auto-tips { margin: 0 1px; list-style: none;height:auto !important;padding: 0px;position:absolute; border:1px solid #ccc; top:27px; left:0; z-index:999; width:100%;background:#fff !important;}' +
'.auto-tips p {overflow: hidden;margin: 1px 0 !important;padding: 5px 5px;border-bottom: 1px solid #e7e7e7;color: #666;text-decoration: none;line-height: 23px;white-space: nowrap;cursor: pointer;zoom: 1;}' +
'.auto-tips p img{ vertical-align:middle;float:left;}' +
'.create-input{line-height:26px,padding-left:3px;}' +
'.create-input span{margin-top:1px;padding-left:3px;height:24px;line-height:24px;float:left;}' +
'.create-input span i,.auto-tips span a{font-style:normal;float:left;cursor:default;}' +
'.create-input span a{padding:0 0px 0 3px;margin-top:1px;cursor:pointer;}' +
'.auto-tips p.hoverBg {background-color: #669cb6;color: #fff;cursor: pointer;}' +
'.hidden {display:none;}'; this._addStyleSheet(stylesheet); },
/**
* 键盘上下键操作
*/
_keyUpAndDown: function(targetVal,e,targetParent) {
var self = this,
_cache = self.cache,
_config = self.config; // 如果请求成功后 返回了数据(根据元素的长度来判断) 执行以下操作
if($('.auto-tips p',targetParent) && $('.auto-tips p',targetParent).length > 0) { var plen = $('.auto-tips p',targetParent).length,
keyCode = e.keyCode;
_cache.oldIndex = _cache.currentIndex; // 上移操作
if(keyCode == 38) {
if(_cache.currentIndex == -1) {
_cache.currentIndex = plen - 1;
}else {
_cache.currentIndex = _cache.currentIndex - 1;
if(_cache.currentIndex < 0) {
_cache.currentIndex = plen - 1;
}
}
if(_cache.currentIndex !== -1) { !$('.auto-tips .p-index'+_cache.currentIndex,targetParent).hasClass(_config.hoverBg) &&
$('.auto-tips .p-index'+_cache.currentIndex,targetParent).addClass(_config.hoverBg).siblings().removeClass(_config.hoverBg);
var curAttr = $('.auto-tips .p-index'+_cache.currentIndex,targetParent).attr('data-html'),
embId = $('.auto-tips .p-index'+_cache.currentIndex,targetParent).attr('embId'); // 判断是否是多选操作
if(_config.manySelect) {
_cache.inputArrs.push(curAttr);
_cache.inputArrs = self._unique(_cache.inputArrs);
self._manySelect(targetParent);
}else {
$(_config.targetCls,targetParent).val(curAttr);
// 上移操作增加一个属性 当失去焦点时候 判断有没有这个属性
if(!$(_config.targetCls,targetParent).attr('up')){
$(_config.targetCls,targetParent).attr('up','true');
}
var pCls = $(_config.targetCls,targetParent).closest(_config.parentCls);
$(_config.hiddenCls,pCls).val(embId); self._createDiv(targetParent,curAttr);
self._closed(targetParent);
// hover
self._hover(targetParent);
} } }else if(keyCode == 40) { //下移操作
if(_cache.currentIndex == plen - 1) {
_cache.currentIndex = 0;
}else {
_cache.currentIndex++;
if(_cache.currentIndex > plen - 1) {
_cache.currentIndex = 0;
}
}
if(_cache.currentIndex !== -1) { !$('.auto-tips .p-index'+_cache.currentIndex,targetParent).hasClass(_config.hoverBg) &&
$('.auto-tips .p-index'+_cache.currentIndex,targetParent).addClass(_config.hoverBg).siblings().removeClass(_config.hoverBg);
var curAttr = $('.auto-tips .p-index'+_cache.currentIndex,targetParent).attr('data-html'),
embId = $('.auto-tips .p-index'+_cache.currentIndex,targetParent).attr('embId'); // 判断是否是多选操作
if(_config.manySelect) {
_cache.inputArrs.push(curAttr);
_cache.inputArrs = self._unique(_cache.inputArrs);
self._manySelect(targetParent);
}else {
$(_config.targetCls,targetParent).val(curAttr);
// 下移操作增加一个属性 当失去焦点时候 判断有没有这个属性
if(!$(_config.targetCls,targetParent).attr('down')){
$(_config.targetCls,targetParent).attr('down','true');
} var pCls = $(_config.targetCls,targetParent).closest(_config.parentCls);
$(_config.hiddenCls,pCls).val(embId);
self._createDiv(targetParent,curAttr);
self._closed(targetParent);
// hover
self._hover(targetParent); } }
}else if(keyCode == 13) { //回车操作
var curVal = $('.auto-tips .p-index'+_cache.oldIndex,targetParent).attr('data-html'); if($(_config.targetCls,targetParent).attr('up') || $(_config.targetCls,targetParent).attr('down')) {
$(_config.targetCls,targetParent).val(curVal);
if(_config.isSelectHide) {
!$(".auto-tips",targetParent).hasClass('hidden') && $(".auto-tips",targetParent).addClass('hidden');
!$(_config.targetCls,targetParent).hasClass('hidden') && $(_config.targetCls,targetParent).addClass('hidden');
}
}
_cache.currentIndex = -1;
_cache.oldIndex = -1; }
}
},
_keyCode: function(code) {
var arrs = ['17','18','38','40','37','39','33','34','35','46','36','13','45','44','145','19','20','9'];
for(var i = 0, ilen = arrs.length; i < ilen; i++) {
if(code == arrs[i]) {
return i;
}
}
return -1;
},
_doPostAction: function(targetVal,targetParent) { var self = this,
_cache = self.cache,
_config = self.config,
url = _config.url;
$.get(url+"?keyword="+targetVal+"&timestamp="+new Date().getTime(),function(data){
var ret = $.parseJSON(data.content),
results = ret.results;
if(results.length > 0) {
self._renderHTML(results,targetParent);
self._executeClick(results,targetParent);
}else {
!$('.auto-tips',targetParent).hasClass('hidden') && $('.auto-tips',targetParent).addClass("hidden");
$('.auto-tips',targetParent).html(''); }
});
},
_renderHTML: function(ret,targetParent) {
var self = this,
_config = self.config,
_cache = self.cache,
html = ''; for(var i = 0, ilen = ret.length; i < ilen; i+=1) {
html += '<p data-html = "'+ret[i].lastName+'" embId="'+ret[i].emplId+'" class="p-index'+i+'">' +
'<img src="'+ret[i].image+'" style="margin-right:5px;" height="25" width="25" title="" alt="">' +
'<span>'+ret[i].lastName+'('+ret[i].emplId+')</span>' +
'</p>';
}
// 渲染值到下拉框里面去
$('.auto-tips',targetParent).html(html);
$('.auto-tips',targetParent).hasClass('hidden') && $('.auto-tips',targetParent).removeClass('hidden');
$('.auto-tips p:last',targetParent).css({"border-bottom":'none'}); _config.renderHTMLCallback && $.isFunction(_config.renderHTMLCallback) && _config.renderHTMLCallback(); // 出现滚动条 计算p的长度 * 一项p的高度 是否大于 设置的高度 如是的话 出现滚动条 反之
var plen = $('.auto-tips p',targetParent).length,
pheight = $('.auto-tips p',targetParent).height(); if(_config.height > 0) {
if(plen*pheight > _config.height) {
$('.auto-tips',targetParent).css({'height':_config.height,'overflow':'auto'});
}else {
$('.auto-tips',targetParent).css({'height':'auto','overflow':'auto'});
}
}
},
/**
* 当数据相同的时 点击对应的项时 返回数据
*/
_executeClick: function(ret,targetParent) {
var self = this,
_config = self.config,
_cache = self.cache;
$('.auto-tips p',targetParent).unbind('click');
$('.auto-tips p',targetParent).bind('click',function(e){
var dataAttr = $(this).attr('data-html'),
embId = $(this).attr('embId'); // 判断是否多选
if(_config.manySelect) {
_cache.inputArrs.push(dataAttr);
_cache.inputArrs = self._unique(_cache.inputArrs);
self._manySelect(targetParent);
}else {
$(_config.targetCls,targetParent).val(dataAttr);
var parentCls = $(_config.targetCls,targetParent).closest(_config.parentCls),
hiddenCls = $(_config.hiddenCls,parentCls);
$(hiddenCls).val(embId); self._createDiv(targetParent,dataAttr);
self._hover(targetParent); !$(_config.targetCls,targetParent).hasClass('hidden') && $(_config.targetCls,targetParent).addClass('hidden');
}
self._closed(targetParent);
if(_config.isSelectHide) {
!$('.auto-tips',targetParent).hasClass('hidden') && $('.auto-tips',targetParent).addClass('hidden');
}
_config.callback && $.isFunction(_config.callback) && _config.callback();
}); // 鼠标移上效果
$('.auto-tips p',targetParent).hover(function(e){
!$(this,targetParent).hasClass(_config.hoverBg) &&
$(this,targetParent).addClass(_config.hoverBg).siblings().removeClass(_config.hoverBg);
});
},
_hover: function(targetParent){
$('.create-input span',targetParent).hover(function(){
$(this).css({'padding-left':'3px'});
},function(){ });
$('.create-input .alink',targetParent).hover(function(){
$(this).css({'color':'#D96500'});
},function(){
$(this).css({'color':''});
});
},
// 动态的创建div标签 遮住input输入框
_createDiv: function(targetParent,dataAttr){
var self = this,
_config = self.config;
var iscreate = $('.create-input',targetParent); // 确保只创建一次div
if(iscreate.length > 0) {
$('.create-input',targetParent).remove();
}
$(targetParent).prepend($('<div class="create-input"><span><i></i></span></div>')); $('.create-input span i',targetParent).html(dataAttr);
$(_config.targetCls,targetParent).val(dataAttr);
$('.create-input span',targetParent).append('<a class="alink">X</a>');
$('.alink',targetParent).css({'float':'left','background':'none'});
var parentWidth = $(targetParent).outerWidth(),
parentheight = $(targetParent).outerHeight(),
iwidth = $('.create-input i',targetParent).outerWidth(),
closedWidth = $('.create-input .alink').outerWidth();
if(iwidth >= parentWidth - closedWidth - 3) {
$('.create-input span i',targetParent).css({'width':(parentWidth - closedWidth - 3)+'px','overflow':'hidden','float':'left','height':parentheight});
} },
// X 关闭事件
_closed: function(targetParent){
var self = this,
_config = self.config;
/*
* 点击X 关闭按钮
* 判断当前输入框有没有up和down属性 有的话 删除掉 否则 什么都不做
*/
$('.alink',targetParent).click(function(){
$('.create-input',targetParent) && $('.create-input',targetParent).remove();
$(_config.targetCls,targetParent) && $(_config.targetCls,targetParent).hasClass('hidden') &&
$(_config.targetCls,targetParent).removeClass('hidden');
$(_config.targetCls,targetParent).val('');
//清空隐藏域的值
var curParent = $(_config.targetCls,targetParent).closest(_config.parentCls);
$(_config.hiddenCls,curParent).val(''); var targetInput = $(_config.targetCls,targetParent);
if($(targetInput).attr('up') || $(targetInput).attr('down')) {
$(targetInput).attr('up') && $(targetInput).removeAttr('up');
$(targetInput).attr('down') && $(targetInput).removeAttr('down');
}
_config.closedCallback && $.isFunction(_config.closedCallback) && _config.closedCallback();
});
},
/*
* 数组去重复
*/
_unique: function(arrs) {
var obj = {},
newArrs = [];
for(var i = 0, ilen = arrs.length; i < ilen; i++) {
if(obj[arrs[i]] != 1) {
newArrs.push(arrs[i]);
obj[arrs[i]] = 1;
}
}
return newArrs;
},
/*
* 输入框多选操作
*/
_manySelect: function(targetParent) {
var self = this,
_config = self.config,
_cache = self.cache;
if(_cache.inputArrs.length > 0) {
$(_config.targetCls,targetParent).val(_cache.inputArrs.join(','));
}
},
/*
* 判断是否是string
*/
_isString: function(str) {
return Object.prototype.toString.apply(str) === '[object String]';
},
/*
* JS 动态添加css样式
*/
_addStyleSheet: function(refWin, cssText, id){ var self = this;
if(self._isString(refWin)) {
id = cssText;
cssText = refWin;
refWin = window;
}
refWin = $(refWin);
var doc = document;
var elem; if (id && (id = id.replace('#', ''))) {
elem = $('#' + id, doc);
} // 仅添加一次,不重复添加
if (elem) {
return;
} //elem = $('<style></style>'); 不能这样创建 IE8有bug
elem = document.createElement("style"); // 先添加到 DOM 树中,再给 cssText 赋值,否则 css hack 会失效
$('head', doc).append(elem); if (elem.styleSheet) { // IE
elem.styleSheet.cssText = cssText;
} else { // W3C
$(elem).append(doc.createTextNode(cssText));
}
},
/*
* 销毁操作 释放内存
*/
destory: function() {
var self = this,
_config = self.config,
_cache = self.cache;
_cache.ret = [];
_cache.currentIndex = 0;
_cache.oldIndex = 0;
_cache.inputArrs = [];
_config.targetCls = null;
}
};
// 初始化
$(function(){
var auto = new AutoComplete({
url: '/rocky/commonservice/user/find.json'
});
});

JS输入框模糊匹配下载

编写简易的JS输入框模糊查询匹配(附有源码和demo)的更多相关文章

  1. vue 如何实现 Input 输入框模糊查询方法

    原理:原生js的indexOf() 方法,该方法将从头到尾地检索数组,看它是否含有对应的元素.开始检索的位置在数组 start 处或数组的开头(没有指定 start 参数时).如果找到一个 item, ...

  2. Mybatis+SpringMVC实现分页查询(附源码)

    Maven+Mybatis+Spring+SpringMVC实现分页查询(附源码) 一.项目搭建 关于项目搭建,小宝鸽以前写过一篇Spirng+SpringMVC+Maven+Mybatis+MySQ ...

  3. js实现模糊查询

    1.简述 实现模糊查询方法有很多种,后端可以实现,前端使用js也可以实现. 后端实现起来需要根据输入框中搜索的关键字,去后台拼接SQL语句查询. 前端直接使用字符串的indexOf()方法或者正则表达 ...

  4. js的模糊查询

    在项目中会用到模糊查询,之前在首页是用的element的tree显示的目录,会有用到搜索,但tree里边会有自带的模糊查询,用filter-node-method方法使用 但上次的项目中 又涉及到不试 ...

  5. arcgis api 3.x for js 入门开发系列四地图查询(附源码下载)

    前言 关于本篇功能实现用到的 api 涉及类看不懂的,请参照 esri 官网的 arcgis api 3.x for js:esri 官网 api,里面详细的介绍 arcgis api 3.x 各个类 ...

  6. Neo4j 不区分大小写的模糊查询匹配

    问题:当图数据库中存储的节点的名字为英文时,就会遇到大小写不匹配问题. 使用不区分大小写的正则表示式可以解决以上问题. Cpyher的where语法里支持正则表达式 ,其语法为 :   =~ &quo ...

  7. 模糊查询(附上源码和jquery-1.12.1.js,jquery-ui.js,jquery-ui.css)

    直接上源码: <!doctype html> <html lang="en"> <head> <meta charset="ut ...

  8. 编写轻量ajax组件03-实现(附源码)

    前言 通过前两篇的介绍,我们知道要执行页面对象的方法,核心就是反射,是从请求获取参数并执行指定方法的过程.实际上这和asp.net mvc框架的核心思想很类似,它会解析url,从中获取controll ...

  9. 基于Socket通讯(C#)和WebSocket协议(net)编写的两种聊天功能(文末附源码下载地址)

    今天我们来盘一盘Socket通讯和WebSocket协议在即时通讯的小应用——聊天. 理论大家估计都知道得差不多了,小编也通过查阅各种资料对理论知识进行了充电,发现好多demo似懂非懂,拷贝回来又运行 ...

随机推荐

  1. Linux常用基本命令(软链接与硬链接 )

    硬链接:相当于文件的多个入口,作用:备份文件,创建快照等 软链接:相当于windows的快捷方式 命令格式: ln option 源文件 目标文件 -s: 创建软链接 1,创建硬链接: ghostwu ...

  2. 尝试笔记 01 之 CSS 边角上的标签

    作者: 八月未见 博客: https://www.cnblogs.com/jmtm/ 以下内容我仅尝试了Firefox浏览器,其他浏览器效果未知. 尝试做一个 CSS 写的角标,因为不能把它移到角落去 ...

  3. 关于初步搭建完成SSH环境之后,JUnit test 测试成功,页面测试时:@Resource 注入的dao为null

    这个问题研究了一天,还是因为配置的时候没有认真,一不小心,酿成了大错.当发现的时候感觉好尴尬啊::>_<:: CostAction: package com.tenni.action; i ...

  4. 解决ubuntu 16.04+ Qt 5.7.1无法输入中文的问题

    解决方法: 1.命令行安装fcitx-frontend-qt5 sudo apt-get install fcitx-frontend-qt5 结果显示如下图,说明我的fcitx-frontend-q ...

  5. x64系统WSC注册方法

    @echo off title 注册WSC脚本部件 echo. ***************************************** echo. 支持x64系统(请以管理员身份运行) e ...

  6. 通过代码动态创建Windows服务

    开发完Windows服务后,一般通过如下命令进行注册Windows服务 @echo off %SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\inst ...

  7. javascript的异步编程解决方案收集

    缘起 没理解js异步的同学看下面的例子: for (var i = 0; i < 5; i++) { //模拟一个异步操作 setTimeout(() => { console.log(i ...

  8. ubantu 16.4 Hadoop 完全分布式搭建

    一个虚拟机 1.以  NAT网卡模式   装载虚拟机 2.最好将几个用到的虚拟机修改主机名,静态IP     /etc/network/interface,这里 是 s101 s102  s103 三 ...

  9. smarty详细使用教程(韩顺平smarty模板技术笔记)

    MVC是一种开发模式,强调数据的输入.处理.显示是强制分离的 Smarty使用教程1.如何配置我们的smarty解压后把libs文件夹放在网站第一级目录下,然后创建两个文件夹templates 存放模 ...

  10. DevOps之基础设施-电力

    唠叨话 关于噢屁事的知识点,仅提供精华汇总,具体知识点细节,参考教程网址,如需帮助,请留言. <基础设施-电力> 关于基础设施的电力部分,知识与技能的层次(知道.理解.运用),理论与实践的 ...