function loadBookmarklet() { var scriptT = document.createElement("script"); scriptT.src = "http://abc.com/tinymce/jscripts/tiny_mce/tiny_mce.js"; scriptT.type = "text/javascript";
document.body.appendChild(scriptT); tinyMCE.init({ mode : "textareas", theme : "simple" }); };
i am getting the error tinyMCE is not defined, can anyone please help me with this?
New Error
Here is the new code that i have which is giving me another error
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);
}
in my widget.js i am trying to set the textarea in the widget.js to the editor
newTM.activeEditor.setContent(selectedText);
the error is
newTM.activeEditor is null