我无法将 JconfirmAction 与此代码进行比较:
<script type="text/javascript">
$(function () {
$(".delbutton").click(function () {
//Save the link in a variable called element
var element = $(this);
//Find the id of the link that was clicked
var del_id = element.attr("id");
//Built a url to send
var info = 'id=' + del_id;
if (confirm("Sure you want to delete this update? There is NO undo!")) {
$.ajax({
type: "GET",
url: "ajax_delete.php",
data: info,
success: function () {
}
});
$(this).parents(".record").animate({
backgroundColor: "#fbc7c7"
}, "fast")
.animate({
opacity: "hide"
}, "slow");
}
return false;
});
});
</script>
我尝试使用以下代码将此脚本添加到存在页面:
<script type="text/javascript">
$(document).ready(function() {
$('.ask-custom').jConfirmAction({question : "Usunąć ?", yesAnswer : "Tak", cancelAnswer : "Nie"});
});
</script>
链接class
:
<a href="#" id="<?php echo $row['id']; ?>" title="DELETE" class="ask-custom delbutton">
任何提示?此致。