[英]how to disable the link in Colorbox iframe?
<a class='iframe' href="delete.php" onClick="chkDel()">
我將iframe與Colorbox一起使用,單擊鏈接后,我將彈出一個類似於代碼的確認框:
function chkDel(){
if(!confirm("delete?")){
//how to stay in the current state?
//and do not run the delete page
}
}
如果用戶取消,則返回false。 返回false將阻止執行。
function chkDel(){
if(!confirm("delete?")){
return false;
}
}
您甚至可以在onClick屬性內的一行中完成此操作。
onClick="return confirm('Are you sure about deleting this?');"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.