老鬼的博客 来都来啦,那就随便看看吧~
常用知识点
发布于: 2018-05-11 更新于: 2019-11-12 分类于:  阅读次数: 

struts2控制字符串的长度

1
2
3
4
5
6
<s:if test="wxUser.nickName.length()>8">
<s:property value="wxUser.nickName.substring(0, 8)"/>
</s:if>
<s:else>
<s:property value="wxUser.nickName"/>
</s:else>

sql批量插入数据

1
2
3
4
5
6
7
8
9
SET IDENTITY_INSERT TestTable ON
declare @i int
set @i=1
while @i<=20000
begin
insert into TestTable([id], FirstName, LastName, Country,Note) values(@i, 'FirstName_XXX','LastName_XXX','Country_XXX','Note_XXX')
set @i=@i+1
end
SET IDENTITY_INSERT TestTable OFF

linux zip打包指令

1
zip -r admin.zip  admin.bluedeer.com.cn/

windows查看端口pid

1
netstat -ano

ajax

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
ajax请求格式
*/
$.ajax({
url:'portDownload.action',//url
type:'post',//提交方式
data:$('form').serialize(),//参数
dataType:'json', //返回类型
success:function(json){//正确返回执行的函数
if(json.success){
window.location.href=location.origin+json.msg;
}else{
alert(json.msg);
}
},
error:function(json){//错误返回执行的函数
alert('服务器不稳定!');
}
});

$.post("ajax/test.html", function(data) {
$(".result").html(data);
});

微信隐藏分享到朋友圈

1
2
3
4
5
6
<script type="text/javascript">
wx.ready(function(){
var cfg = {menuList: ["menuItem:share:timeline"]};
wx.hideMenuItems(cfg);
});
</script>

dos命令

1
2
3
4
5
6
rmdir /s/q test 
其中:
/s 是代表删除所有子目录跟其中的档案。
/q 是不要它在删除档案或目录时,不再问我 Yes or No 的动作。
要删除的目录前也可以指定路径,如:
rmdir /s/q d:/temp/test
1
2
3
4
5
6
rmdir /s/q C:\SVN\tookeen-renjie\WEB-INF\content;
rmdir /s/q C:\SVN\tookeen-renjie\static;
rmdir /s/q C:\SVN\tookeen-renjie\WEB-INF\classes\com;
XCOPY C:\JavaProgram\tookeen\trunk\code\src\main\webapp\WEB-INF\content C:\SVN\tookeen-renjie\WEB-INF\content /S/E/I/Y;
XCOPY C:\JavaProgram\tookeen\trunk\code\src\main\webapp\static C:\SVN\tookeen-renjie\static /S/E/I/Y;
XCOPY C:\JavaProgram\tookeen\trunk\code\target\classes\com C:\SVN\tookeen-renjie\WEB-INF\classes\com /S/E/I/Y;

Js unbind事件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var foo = function eliteSubmit(){
$('.page6_form_submit').unbind();
$('.formAlert_p').text('请完整填写:');
var _alert = "";
var isFinish=true;
$('.page6_form .inp').each(function(){
if($(this).val()===''){
isFinish=false;
var this_pla=$(this).attr('placeholder');
_alert +=$(this).attr('placeholder')+ ",";
//$('.formAlert_p').append(this_pla+',');
}
});
if(!isFinish){
$('.formAlert_p').append(_alert.substring(0,_alert.length-1));
$('.formAlert').show();
$('.page6_form_submit').bind('click',foo);
$('.page6_form_submit').text('立即提交');
}else{

var _data = $('.page6_form').serialize();
console.log('data is : ' + _data);
//保存信息
$.ajax({
url:'saveEliteData.action',//url
type:'post',//提交方式
data:_data,//参数
dataType:'json', //返回类型
success:function(json){//正确返回执行的函数
if(json.success){
mySwiper.removeSlide([0,1,2,3,4]);
mySwiper.params.allowSwipeToNext=false;
mySwiper.params.allowSwipeToPrev=false;
$('.page6_form_submit').bind('click',foo);
$('.page7').show();
}else{
$('.page6_form_submit').bind('click',foo);
alert(json.msg);
$('.page6_form_submit').text('立即提交');
}
},
error:function(json){//错误返回执行的函数
alert('服务器不稳定!');
$('.page6_form_submit').bind('click',foo);
$('.page6_form_submit').text('立即提交');
}
});

}
};
// 表单验证
$('.page6_form_submit').on('click',function(){
console.log(1);
$('.page6_form_submit').text('正在提交...');
foo();
});

*************感谢您的阅读*************