enters the page only once, but the breakpoint skips to this method and executes the method again after a request. What is the reason for this?
The order ofbreakpoints is that they are called twice first and do not enter the method. After calling the method twice, I went into the method again, and then walked the method twice.
//
function getAllUsers(pagenum) {
$.ajax({
url: "/user/getAllUsers",
data: {
"pagenum": pagenum
},
type: "post",
dataType: "json",
success: function(data) {
if (data.flag == "success") {
$("tbody").html(" ")
var list = data.Data;
var count = data.count;
//
for (var i = 0; i < list.length; iPP) {
var num = i + (pagenum - 1) * 10 + 1; //
$("tbody").append(
`<tr id="${list[i].uid}">
<td>${num}</td>
<td class="accountName">${list[i].username}</td>
<td class="accountPass">${list[i].password}</td>
<td class="role">${list[i].rolename}</td>
<td class="lastTime">${list[i].lastlogintime}</td>
<td class="lastIP">${list[i].lastloginip}</td>
<td><i class="fa fa-edit modify" data-toggle="modal" data-target="-sharpmodifyUserModal" title=""></i>
<i class="fa fa-trash-o deleteUser" title=""></i>
</td>
</tr>
`
)
}
//
layui.use(["laypage"], function() {
var laypage = layui.laypage;
//
laypage.render({
elem: "layPage" // id
,
layout: ["prev", "page", "next", "limits",
"count"
] //
,
limit: 10 //
,
count: count //
,
curr: pagenum //
,
groups: 3 //
,
theme: "-sharp1E9FFF" //
,
skip: true //
,
jump: function(obj, first) { //
if (!first) {
$("tbody").html("");
getUserLog(obj.curr)
}
}
});
})
} else {
layer.msg("", {
offset: "3.8%",
});
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
console.log(XMLHttpRequest.status);
console.log(XMLHttpRequest.readyState);
console.log(textStatus);
}
})
}
$(function(){
getAllUsers(1)
})