a link in a confirmation dialog box JS method

One of:

<a href="javascript:if(confirm('确实要删除该内容吗?'))location='http://www.google.com'"> pop-up window </a>

Two kinds:

<Script Language = "JavaScript">             
function delete_confirm (E) 
{
    IF (event.srcElement.outerText == "delete") 
    {
        event.returnValue = Confirm The ( "Delete is unrecoverable, you sure you want to delete it?");
    }
}
the document.onclick = delete_confirm;
</ Script>

<a href="Delete.aspx" onClick="delete_confirm">删除</a>

Three ways:

if (window.confirm ( 'Are you sure you want to cancel the transaction?')) {
                 // Alert ( "OK");
                 return to true;
              } the else {
                 // Alert ( "Cancel");
                 return false;
             }

 

Four categories:

 <script language="JavaScript">             

function delete_confirm () <- calling method -!>
{
    event.returnValue = Confirm The ( "Delete is unrecoverable, you sure you want to delete it?");
}
</ Script>

Guess you like

Origin www.cnblogs.com/apolloren/p/10958448.html