I’m trying to add TinyMCE to a Meteor app, and have been able to do so with no problem when I use the external TinyMCE script, but can’t figure out how to run it from the server.
I have all the files in my ‘public’ folder, and tried a bunch of things, but can’t figure out how to get meteor to recognize them.
This works perfectly using an external script:
if (Meteor.isClient) {
Template.TemplateName.onCreated(function(){
$.getScript('//tinymce.cachefly.net/4.2/tinymce.min.js', function(){
tinymce.init({selector:'textarea'});
})}
}
But if I try to replace the third line with following, tinyMCE never loads at all:
Is there another way to load a script from public, or am I doing something wrong? I googled, but the only suggestion was just to include the script in the , but that didn’t work either. I feel like I must be missing something obvious.
Hm. That clearly made a difference – it seems to be partially loading as opposed to not loading at all? Now I’m unsure as to if this is a meteor-specific issue or a TinyMCE issue.
TinyMCE is meant to replace textareas with its own editor. If it doesn’t load, you’d normally see a regular textarea, but at this point I’m seeing neither the textarea or the editor.
Oh, thank you! Looking forward to trying it this way when I get a chance, likely tomorrow. But wanted to sneak the thanks in today – this is definitely different from anything I’d tried, and looks promising.