Jquery アコーディオンで ckeditor を使用しています。ckeditor の後のすべてのアコーディオンにボタンがあります。
その保存ボタンをクリックして、ckeditorの内容をチェックしています。値が何もない場合は、jqueryのダイアログボックスに適切なエラーメッセージを表示したいと思います。
しかし、それは私にエラーを与えています
Error: TypeError: $(...).dialog is not a function
アコーディオンにckeditorを追加する私のコード
$("#question-container textarea").each(function(){
CKEDITOR.replace(($(this).attr('id')), subjetive_config);
});
エラーが発生した場合にダイログを呼び出す私のコード
var editor = CKEDITOR.instances[textarea_id];
if (editor) { editor.destroy(true); }
$("#dialog").html("Answer can not be empty!");
$("#dialog").attr('title', 'Error');
$("#dialog").dialog({draggable: false,resizable: false,modal: true,buttons: { "Close": function() {
$(this).dialog("destroy");
}
}
});
}
ポインタや提案は素晴らしいでしょう
ありがとう