js分页input跳转的三种方式,回车跳转,输入框外侧点击自动跳转,加按钮跳转,input页码跳转
js分页input跳转的三种方式,回车跳转,输入框外侧点击自动跳转,加按钮跳转,input页码跳转
·
// 输入框回车键跳转
document.onkeydown = function(e){
if(e.keyCode == 13){
inputa();
}
}
// 输入框点击外侧跳转
document.addEventListener("click", function(e) {
if(e.target.id !="inputer"){
inputa();
}
})
// 输入框确定按钮跳转
function inputa(){
if (document.getElementById("inputer").value > totalPage) {
document.getElementById("inputer").value = totalPage;
//totalpage是最大页码
}
var datas = {
"curstarttime": curstarttime,
"curendtime": curendtime,
"deptid": deptid,
"areaid": areaid,
"version": version,
"yujinglx": yujinglx,
"pageNum": document.getElementById("inputer").value, //页码
"shuju_fl": totalname,
};
$.ajax({
url: "http://",
type: 'POST',
contentType: "application/json; charset=utf-8",
data: JSON.stringify(datas),
success: function(response) {
loadorderlist(response.data);
}
});
}
更多推荐
已为社区贡献2条内容
所有评论(0)