简体   繁体   中英

How to get my formatted content from tinyMCE using javascript?

I've installed TinyMCE and when my form is posted traditional way (into some php page) it's not a problem, cause I can pass the variable throug stripslashes() function or something like that.

Unfortunately, one of my forms is passed via jquery $.ajax module - and there any PHP manipulations are impossible. Is there a way to pass full formatted tinyMCE output via javascript, because now it can't see any formatting i've done.

According to this answer: https://stackoverflow.com/a/6541822/349012 it's possible:

// Get the HTML contents of the currently active editor
tinyMCE.activeEditor.getContent();

// Get the raw contents of the currently active editor
tinyMCE.activeEditor.getContent({format : 'raw'});

// Get content of a specific editor:
tinyMCE.get('content id').getContent()

Another reference: https://stackoverflow.com/a/11112221/349012

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM