函数 loadBookmarklet() { var scriptT = document.createElement("script"); scriptT.src = " http://abc.com/tinymce/jscripts/tiny_mce/tiny_mce.js "; scriptT.type = "文本/javascript";
document.body.appendChild(scriptT); tinyMCE.init({ mode : "textareas", theme : "simple" }); };
我收到错误 tinyMCE 未定义,谁能帮我解决这个问题?
新错误
这是我拥有的新代码,它给了我另一个错误
function loadBookmarklet() {
var scriptT = document.createElement("script");
scriptT.src = "http://abc.com/tiny_mce.js";
scriptT.type = "text/javascript";
scriptT.onload = function(){}
document.body.appendChild(scriptT);
tinyMCE.init({ mode : "textareas", theme : "simple" });
newTM = tinyMCE;
var scriptW = document.createElement("script");
scriptW.src = "http://abc.com/widget.js";
scriptW.type = "text/javascript";
document.body.appendChild(scriptW);
}
在我的 widget.js 中,我试图将 widget.js 中的 textarea 设置为编辑器
newTM.activeEditor.setContent(selectedText);
错误是
newTM.activeEditor 为空