Forum Discussion
luk
Boss
jacques_ca did you wrap that code into an IIFE? e.g.
;(function($) { // runs when an editor instance is added to the EditorManager list tinymce.on('addeditor', function(e) { var editor = e.editor; // wait for this particular editor instance to be initialized editor.on('init', function(e) { // when the editor is initialized, add the custom text editor.execCommand('mceInsertContent', false, '<p id="123">bolded text</p>'); }); }, true); })(LITHIUM.jQuery); // technically })(); is enough, no jQuery here...
works for me here, I think if you do it via console, you're way too late in the javascript event lifecycle.
jacques_ca
7 years agoMaven
Thanks for getting back to me. Yes, It is what I did. If it worked for you then the issue may come from something else...
Related Content
- 4 years ago
- 2 years ago
- 2 years ago
- 3 years ago
- 8 years ago