【发布时间】:2016-12-05 23:41:25
【问题描述】:
onclick='return confirm('Delete this comment?')' 似乎根本不起作用:
<?php
if($sesType == 'Admin') {
echo "<a href = 'editCom.php?id=$commentID'>Edit</a> ";
echo "<a href='deleteCom.php?id=$commentID' onclick='return confirm('Delete this comment?')'>Delete</a>";
} else if($_SESSION["username"] != NULL AND $_SESSION["username"] == $postname) {
echo "<a href = 'editCom.php?id=$commentID'>Edit</a> ";
echo "<a href='deleteCom.php?id=$commentID' onclick='return confirm('Delete this comment?')'>Delete</a>";
}
?>
但是没有出现确认框。
【问题讨论】:
-
我也试过用javascript做,但结果一样
-
您正在以一种行不通的方式混合引用字符。
-
查看浏览器的 javascript 控制台,单击锚点时可能会看到错误消息。
标签: php anchor href confirmation