jquery - TinyMCE not initializing, but no JavaScript errors -
i have simple email form (for members-only page private club) send email blasts. code simply:
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="../../../tinymce/jscripts/tiny_mce/tiny_mce.js"></script> </head> <body> <h1>email blast</h1> <form method="post"> <input type="hidden" name="from" value="blast@club.com" /> <input type="hidden" name="to" value="blast@club.com" /> <input type="hidden" name="reply" value="from@club.com" /> <input type="hidden" name="bcc" value="tester <test@club.com>" /> <label for="subject">subject</label><br/> <input type="text" name="subject" id="subject" style="width: 600px" /><br/> <label for="message">message</label><br/> <textarea id="message" name="message" rows="15" cols="100" class="tinymce"></textarea><br/> <br/><input type="submit" value="send email" name="submit"> </form> </body> <script type="text/javascript"> jquery(document).ready(function() { tinymce.init({selector:"textarea.tinymce"}); }); </script>
for reason page isn't rendering textarea.tinymce
expect, there no error messages in js console , breakpoints hit expect.
what missing?
you should place script
tag inside body
tag, before closing it.
if put after closing body
tag, browser ignore it.
look @ example below - if place script
tag inside body
tag, works charm:
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.2.5/tinymce.jquery.min.js"></script> </head> <body> <h1>email blast</h1> <form method="post"> <input type="hidden" name="from" value="blast@club.com" /> <input type="hidden" name="to" value="blast@club.com" /> <input type="hidden" name="reply" value="from@club.com" /> <input type="hidden" name="bcc" value="tester <test@club.com>" /> <label for="subject">subject</label><br/> <input type="text" name="subject" id="subject" style="width: 600px" /><br/> <label for="message">message</label><br/> <textarea id="message" name="message" rows="15" cols="100" class="tinymce"></textarea><br/> <br/><input type="submit" value="send email" name="submit"> </form> <script type="text/javascript"> jquery(document).ready(function() { tinymce.init({selector:"textarea.tinymce"}); }); </script> </body> </html>
Comments
Post a Comment