使用layer
来源:互联网 发布:新浪php笔试题 编辑:程序博客网 时间:2024/05/29 09:29
<script type="text/javascript" src="static/js/jquery-1.8.3.min.js"></script>
<script src="static/js/layer/layer.js"></script>
<script type="text/javascript">
var temp = "${PWSimple}";
if(temp == "true"){
layer.open({
type: 1,
closeBtn: false,
shift: 7,
resize: false,
title : "初始密码登录,请修改后重新登录!",
shadeClose: false,
content: "<div style='width:350px;height:150px;'><div style='width:300px;margin-left: 3%;margin-bottom:20px;margin-top:10px;' class='form-group has-feedback'> 新密码:<input id='newPassword' class='form-control' maxlength='18' type='password' name='newPassword' value=''/></div>" +
"<div style='width:300px;margin-left: 3%;margin-bottom:20px;' class='form-group has-feedback'>重新输入密码:<input id='secondPassword' maxlength='18' class='form-control' type='password' name='secondPassword' value=''/></div>"+
"<div style='width:300px;margin-bottom:20px;'><ul class='f_ul' style='float:right;'><li><input class='input_yes' id='smt' style='width:65px;' type='submit' onclick='return layoutSave();' value='确定' /></li><li><input class='input_no' onclick='layoutClose();' style='width:65px;' type='button' value='取消' /></li></ul></div></div>"
});
}
function layoutClose(){
layer.close(layer.index);
}
function layoutSave(){
var newPassword = $("#newPassword").val();
var secondPassword = $("#secondPassword").val();
if(newPassword!=secondPassword){
alert("两次密码输入不一致!");
$("#secondPassword").val("");
return false;
}
$.ajax({
url: '/account/user/updatePassword',
type: 'post',
data: {"password":secondPassword,"company":'${company}'},
dataType: 'text',
success: function(data) {
if(data == "success") {
alert("修改成功!");
window.location.href = "/login";
} else {
alert("修改失败!");
}
$(".loading").hide();
}
});
}
<script src="static/js/layer/layer.js"></script>
<script type="text/javascript">
var temp = "${PWSimple}";
if(temp == "true"){
layer.open({
type: 1,
closeBtn: false,
shift: 7,
resize: false,
title : "初始密码登录,请修改后重新登录!",
shadeClose: false,
content: "<div style='width:350px;height:150px;'><div style='width:300px;margin-left: 3%;margin-bottom:20px;margin-top:10px;' class='form-group has-feedback'> 新密码:<input id='newPassword' class='form-control' maxlength='18' type='password' name='newPassword' value=''/></div>" +
"<div style='width:300px;margin-left: 3%;margin-bottom:20px;' class='form-group has-feedback'>重新输入密码:<input id='secondPassword' maxlength='18' class='form-control' type='password' name='secondPassword' value=''/></div>"+
"<div style='width:300px;margin-bottom:20px;'><ul class='f_ul' style='float:right;'><li><input class='input_yes' id='smt' style='width:65px;' type='submit' onclick='return layoutSave();' value='确定' /></li><li><input class='input_no' onclick='layoutClose();' style='width:65px;' type='button' value='取消' /></li></ul></div></div>"
});
}
function layoutClose(){
layer.close(layer.index);
}
function layoutSave(){
var newPassword = $("#newPassword").val();
var secondPassword = $("#secondPassword").val();
if(newPassword!=secondPassword){
alert("两次密码输入不一致!");
$("#secondPassword").val("");
return false;
}
$.ajax({
url: '/account/user/updatePassword',
type: 'post',
data: {"password":secondPassword,"company":'${company}'},
dataType: 'text',
success: function(data) {
if(data == "success") {
alert("修改成功!");
window.location.href = "/login";
} else {
alert("修改失败!");
}
$(".loading").hide();
}
});
}
</script>
附件 layer所需js文件static_js.zip
注:有时会报错,多半是因为文件冲突,把js和jquery文件引用放到前面
阅读全文
1 0
- 使用layer
- layer使用
- layer使用使用初探
- IOS Layer的使用
- layer-list使用
- Android layer-list使用
- ios Layer的使用
- IOS Layer的使用
- ios Layer的使用
- 使用layer.js注意事项
- IOS Layer的使用
- IOS Layer的使用
- layer-list使用
- IOS Layer的使用
- layer 使用中的知识点
- IOS Layer的使用
- IOS Layer的使用
- IOS Layer的使用
- 奋斗方向
- 数组,集合的写法
- hdu1301 最小生成树
- OpenCV显示中文汉字,未使用CvxText和FreeType库,很强大!!
- C#变量(枚举,结构,数组)
- 使用layer
- Android 双时间选择控件
- Android手势识别
- (2)选择器:class选择器、id选择器、关联选择器、组合选择器、伪元素选择器
- vs远程调试
- AssertJ 单元测试工具介绍
- Linux下线程同步
- java小知识点-获取变量得数据类型
- load过程