我有一個簡單的腳本,提示用戶確認刪除,然後它只是提醒他們該過程已正確完成。jConfirm未定義
我嘗試使用jConfirm和JavaScript控制檯吐出: 「的ReferenceError:未定義jConfirm」
<!-- 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');
}
});
}
});
}
在應該使確認對話框中的按鈕,我有:
<a href="#" onclick="careersDelete('<?php echo $career_id; ?>')">delete</a>
是'jQuery'和'jConfirm'庫正確包括? – pes502
是的,他們都正確加載... – Hugo