我使用CKEditor時出現問題(http://ckeditor.com/)。問題是,我找不到一種方法來編輯ReadOnly,並且我不能只使用textarea,因爲我想保持一致性。我已經在StackOwerflow上看到過很多像這樣的問題,但沒有一個能工作或者太舊。CKEditor只讀
到目前爲止我的代碼只是爲了顯示/初始化編輯:
$(document).ready(function(){
CKEDITOR.replace('ckeditor', {
on: {
// Check for availability of corresponding plugins.
pluginsLoaded: function(evt) {
var doc = CKEDITOR.document, ed = evt.editor;
if (!ed.getCommand('bold'))
doc.getById('exec-bold').hide();
if (!ed.getCommand('link'))
doc.getById('exec-link').hide();
}
}
});
});
我用的是最新版本的CKEditor(v.4.1.1全包)
提前感謝! :)
你有沒有試圖使之成爲一個iframe中,而不是textarea的?因爲這會從另一頁面加載內容,並以這種方式使其成爲ReadOnly。 – 2013-04-26 13:03:45