There is such code:
var script = editor.document.createElement('script'); script.setAttribute( 'type', 'text/javascript'); script.setHtml('$(document).ready(function() { console.log("Скрипт вставлен"); });'); editor.insertElement(script); In the document it inserts, but for some reason in the "p" element:
<p> <script type="text/javascript"> $(document).ready(function() { console.log("Скрипт вставлен"); }); </script> </p> And it gives an error:
ReferenceError: $ is not defined ...re=[],b=this.getDocument().$.documentElement,c=this.$;c&&c!=b;){var d=c.parentN...