Jconfirm Is Not Defined
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
Solution 1:
If you check out these examples you'll see that you need to separately source jquery, and that jconfirm is only defined within its namespace. Thus you need to add two things in your code:
<scriptsrc="/js/jquery.js"></script><!-- or wherever jquery.js's path is -->
...
$.jconfirm('Are you sure ...
// note jquery's $. namespace; and the non-capitalized "c" in jconfirm
Additionally, the $.jconfirm
function call is not expecting strings. It signature is:
function(options, callback)
And the callback
is not executed with any parameters (thus your x
will be undefined
). It looks like what you wanted was somewhere along the lines of:
functioncareersDelete(career_id) {
jQuery.jconfirm({
message: 'Are you sure you want to delete this career?',
title: 'Delete Career'
}, function() {
jQuery.ajax({
url: "ajax_career_delete.php",
type: "GET",
data: "career_id=" + career_id,
success: function(response) {
alert('Career deleted');
}
})
});
}
Post a Comment for "Jconfirm Is Not Defined"