The first method: It is very easy to use. Only after confirmation can the download address page be opened. The principle is also relatively clear. Mainly used to confirm deletion of a single message.
Copy the code code as follows:
<SCRIPT LANGUAGE=javascript>
function del() {
var msg = "Are you really sure you want to delete it?/n/nPlease confirm!";
if (confirm(msg)==true){
return true;
}else{
return false;
}
}
</SCRIPT>
Calling method:
Copy the code code as follows:
<a href="del.php?id=123" onclick="javascript:return del()">Delete</a>
Second method: The principle is the same as above. JavaScript delete confirmation box
Copy the code code as follows:
<a href="javascript:if(confirm('Are you sure you want to delete?'))location='jb51.php?id='">Delete</a>
The third type: confirmation prompt mainly used for batch deletion
Copy the code code as follows:
<input name="Submit" type="submit" value="Delete"
onclick="{if(confirm('Are you sure to record?')){
this.document.formname.submit();
return true;}return false;
}">
<input name="Button" type="button" ID="ok" onclick="{if(confirm('Are you sure to delete?')){
window.location='Action.asp?Action=Del&
TableName=Item&
ID=<%=ID%>';
return true;
}return false;}" value="Delete column" />