我应该在脚本中写什么来删除该行
<script type="text/javascript">
function confirmation()
{
var del=confirm("Are you sure you want to delete this record?");
if (del==true){
alert ("record deleted")
}
return del;
}
</script>
体内
<td><a href="movie_list(delete).php?view&movid" onclick="return confirmation();">Delete</a></td>
这部分我应该做什么?
<?php
if (isset(.....)
{
....
header("Location: .....php");
}
?>
最佳答案
将此添加到您的删除按钮
onclick="return confirmDelete();"
将其粘贴到页面的页眉或页脚。
<script>function confirmDelete() {
if (confirm("Sure you want to delete ?") == true) {
return true;
} else {
return false;
}
}
</script>
关于php - 如果单击删除链接,则向用户显示 JavaScript 确认弹出框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54822878/