私は Javascript のスペシャリストではないので、この小さなボタン プラグインが Cleditor で想定されていることを実行する理由について少し混乱していますが、jquery エディターによってエラー警告が表示されます。
コードは次のとおりです。
(function($) {
// Define the hello button
$.cleditor.buttons.video = {
name: "video",
image: "video.gif",
title: "Insert Video",
command: "inserthtml",
buttonClick: videoClick
};
// Add the button to the default controls before the bold button
$.cleditor.defaultOptions.controls = $.cleditor.defaultOptions.controls
.replace("bold", "video bold");
// Handle the hello button click event
function videoClick(e, data) {
// Get the editor
var editor = data.editor;
// Insert some html into the document
var html = "[VIDEO]";
editor.execCommand(data.command, html, null, data.button);
// Hide the popup and set focus back to the editor
// editor.focus();
}
})(jQuery);
ボタンをクリックするとドキュメントに[VIDEO]を挿入するシンプルなプラグインです。
問題は、テキストを挿入した後に何らかの理由でこれが表示されることです
「inserthtml コマンドの実行中にエラーが発生しました」 プラグイン ボタンの下の小さな黄色いウィンドウ。
Javascript の経験がないために見逃しているのは小さなことだと確信しています。
前もって感謝します