I'm loading TinyMCE via JQuery and after it's loaded, I'd like to add a save button to it. The save button is calling a function but Firebug says the function is not defined, in this case destroyTinyMCE() is not defined. What's wrong?
$('div#introText').click(function() {
loadTinyMCE();
$('div#introText').after('<input value="Save" onclick="destroyTinyMCE();" type="button">');
});
function loadTinyMCE() {
//some variable
}
function destroyTinyMCE() {
$('div#introText').tinymce().destroy();
$('div#introText').tinymce().remove();
}