How to enable writing code like js in tinymce editor?

698 Views Asked by At

I'm using tinymce editor in my entire website in which user can write ifames or javascript code and save/update that. But whenever I write js code in it, it hides that. How can I enable tinymce to allow users to write anything in it?

Version: 4.3.10.

http://prntscr.com/dk3a22

as you can see in screenshot, only thing that is left behind is html code. other is removed as soon as in press OK button.

tinymce.init({
selector: "textarea",
allow_script_urls: true,
extended_valid_elements: 'span,script[language|type|src]',
browser_spellcheck: true,
force_br_newlines: true,
force_p_newlines: false,
forced_root_block: '',
font_formats: 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;AkrutiKndPadmini=Akpdmi-n;Comic Sans MS=comic sans ms,sans-serif;Times New Roman=times new roman,times;',
fontsize_formats: '8pt 10pt 12pt 14pt 18pt 24pt 36pt',
plugins: ["textcolor", "advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table paste"],
toolbar: "fontselect | fontsizeselect | forecolor backcolor | insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
height: "200", 
0

There are 0 best solutions below