A:
<a href= "Javascript:if (Do you really want to delete this content? ') {location= ' http://www.google.com '} > Popup </a>
Two kinds:
<script language= "JavaScript" >
function Delete_confirm (e)
{
if (Event.srcElement.outerText = = "Delete")
{
Event.returnvalue = Confirm ("Delete is not recoverable, are you sure you want to delete it?") ");
}
}
Document.onclick = delete_confirm;
</script>
<a href= "delete.aspx" onclick= "delete_confirm" > Delete </a>
Three kinds:
if (window.confirm (' Are you sure you want to cancel the transaction? ‘)){
Alert ("OK");
return true;
}else{
Alert ("Cancel");
return false;
}
Four kinds:
<script language= "JavaScript" >
function delete_confirm () <!--call Method--
{
Event.returnvalue = Confirm ("Delete is not recoverable, are you sure you want to delete it?") ");
}
</script>
Method One explains:
Break it down into three parts:
<a href= "javascript://" > means to execute the appropriate JavaScript code after clicking on the hyperlink.
Confirm () Indicates a dialog box that asks for confirmation, and the user clicks OK to return true, and false to cancel.
The IF (confirm ()) means that if the user chooses OK, the if code is executed, otherwise nothing is done.
The example shows the following:
JS Popup Confirmation Cancel dialog box