P粉4669094492023-08-30 11:58:27
Please add window.location.reload() code after alert....
success: function (data) { if (data.length == 0) // 没有错误 alert("删除成功!"); **window.location.reload();** },
This code will automatically reload your page upon success
P粉0142181242023-08-30 11:51:00
Actually, you deleted the data from the database, but you didn't refresh the page.
Alternatively, you use Dipendrasinh Vaghela's answer and refresh the entire page.
Alternatively, if you have a function that searches and displays in the DOM, you can call it when the deletion is successful. This will "only" update the part showing the data.