my js:
$(document).ready(function() { tinymce.init({ selector: 'textarea', height: 500, menubar: false, plugins: [ 'advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', 'insertdatetime media table contextmenu paste code' ], toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', content_css: '//www.tinymce.com/css/codepen.min.css' }); });
my html:
<textarea></textarea>
i have following external js files included:
http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js http://cdnjs.cloudflare.com/ajax/libs/tinymce/4.5.6/jquery.tinymce.min.js
the js fiddle:
my error:
uncaught referenceerror: tinymce not defined @ htmldocument.<anonymous> ((index):54) @ j (jquery.min.js:2) @ object.add [as done] (jquery.min.js:2) @ m.fn.init.m.fn.ready (jquery.min.js:2) @ window.onload ((index):53
i'm running google chrome 57.0.2987.133 , tinymce code https://www.tinymce.com/docs/demo/basic-example/ .
any ideas?
you need load tinymce - loading jquery wrapper tinymce.
in total need load following:
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.5.6/tinymce.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/tinymce/4.5.6/jquery.tinymce.min.js"></script>
see updated fiddle: http://jsfiddle.net/mfromin/bcv1tv1b/2/
in honesty don't need jquery tinymce code unless want use tinymce jquery plugin. 100% not required make fiddle work.
Comments
Post a Comment