The purpose is to remove a series of data from the database
At the end of each row there is a delete item
However, the deletion requires the user to confirm whether the deletion
I used JavaScript to judge.
<script language= "JavaScript" >
function myconfirm (ID)
{
if (Confirm (OK to delete this user?))
{
DeleteUser (ID)
}
}
</script>
This will jump out of the OK and cancel window basket when calling Javascript:myconfirm ()
If the user clicks OK then executes
<script>function DeleteUser (ID)
{window.location = ("Deleteusercommit.jsp?id= '" +id+ "");
}
</script>
I didn't add this to the DeleteUser () and myconfirm (), but I found this <a href=javascript:myconfirm ("+id+") > Delete </a> If you do not have the ID this parameter can not be passed, I would like to change the position of the DeleteUser () function to get the value of the ID, and then found no, and then add this ID parameter. This goes through without problems.