0
我試圖將jquery-textcomplete與ckeditor和tinyMCE集成。jQuery-textcomplete與CKEditor/TinyMCE集成
我得到了這個錯誤。
TypeError: CKEDITOR.instances.issue_notes is undefined
你可以給我一點幫助,整合jQuery-textcomplete與CKEditor/TinyMCE。你可以看看這裏的代碼示例,https://jsfiddle.net/btjapqkp/
HTML
<script src="https://code.jquery.com/jquery-3.1.0.js" type="text/javascript">
</script>
<script src="https://cdn.ckeditor.com/4.5.10/standard/ckeditor.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.10/adapters/jquery.js">
</script>
的JavaScript
$(document).ready(function(){
tinymce.init({ selector:'#three' });
$('#two').ckeditor();
$('.editable').textcomplete([{
match: /(^|\b)(\w{2,})$/,
search: function (term, callback) {
var words = ['google', 'facebook', 'github', 'microsoft', 'yahoo'];
callback($.map(words, function (word) {
return word.indexOf(term) === 0 ? word : null;
}));
},
replace: function (word) {
return word + ' ';
}
}]);
});