1、利用layui的 layer.msg设置等待效果
var loading = layer.msg('正在进行xx信息采集,请稍候。。。', {icon: 16, shade: 0.1, time: 0});
$.ajax({
type: 'post',
url: "../../imsBill/collection/" + taskId,
data: formData,
success: function (res) {
layer.close(loading);
if (res.result == true) {
layer.msg(res.resultStr, {time: 2000});
} else {
layer.msg(res.resultStr, {time: 2000});
}
}
});
2、设置a标签不可用且置灰
$("#pbcUpload").css("opacity",0.2);
$("#pbcUpload").css("pointer-events","none");
3、重置按钮设置
$("#rev-btn").click(function () {
$("input").val('');
$('select').each(function (i, j) {
$(j).find("option:selected").attr("selected", false);
$(j).find("option").first().attr("selected", true);
form.render('select')
})
});
4、html页面参数传值
function getReqParam(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return ("");
}
var ids = getReqParam("ids");
5、empty() 方法移除被选元素的所有子节点和内容。