I had the same problem. Change your code to this and it should work:
if(window.tinyMCE) { var tmce_ver=window.tinyMCE.majorVersion; if (tmce_ver>="4") { window.tinyMCE.execCommand('mceInsertContent', false, tagtext); } else { window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext); } tinyMCEPopup.editor.execCommand('mceRepaint'); tinyMCEPopup.close(); } return; }
Note. Since .js files are cached, you will need to do a hard update to get this to work. If you still see the same console errors, this is likely to be the cause.
Scott B
source share