I have a simple script that prompts the user to confirm delete, then it just alerts them that the process was completed properly.
I tried using jConfirm and the Javascript console spits out: "ReferenceError: jConfirm is not defined"
<!-- jConfirm -->
// the script is referenced properly
<script src="/js/jconfirm/jquery.jconfirm-1.0.min.js"></script>
<script>
function careersDelete(career_id) {
jConfirm('Are you sure you want to delete this career?', 'Delete Career', function (x) {
if (x) {
jQuery.ajax({
url: "ajax_career_delete.php",
type: "GET",
data: "career_id=" + career_id,
success: function (response) {
alert('Career deleted');
}
});
}
});
}
On the button that should enable the confirm dialog, I have:
<a href="#" onclick="careersDelete('<?php echo $career_id; ?>')">delete</a>