问题
I have been searching for an answer for this for quite some time now, and I haven't been able to find a logical one yet.
I want to use TinyMCE to allow users to post formatted blogs. I don't want to force the user to use HTML tags in the textarea to put a new paragraph, they should just be able to hit the return key to get a new line, push a button to get bolded text, etc... My question is, if I am storing these blog posts in a mysql database, how can I preserve the formatting in the database securely and then show the blog post from the database with the formatting intact?
回答1:
Use getContent:
tinyMCE.activeEditor.getContent();
it will return you the HTML of current tinymce editor, and you can send it to your server.
来源:https://stackoverflow.com/questions/14961732/tinymce-formatted-text-in-mysql-database