<a class='iframe' href="delete.php" onClick="chkDel()">
I have use the iframe with Colorbox, After click the link , i would to popup a confirm box like the code:
function chkDel(){
if(!confirm("delete?")){
//how to stay in the current state?
//and do not run the delete page
}
}
Return false if the user cancels. Returning false will prevent the execution.
function chkDel(){
if(!confirm("delete?")){
return false;
}
}
You can even do it in one line inside the onClick attribute.
onClick="return confirm('Are you sure about deleting this?');"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.