TinyMce sets html content using ajax request

I am really stuck in the TinyMce / JQuery / Php issue and hope someone can advise:

I have a textarea managed with TinyMce that preloaded the html content retrieved using a classic database query. Everything is fine, while here.

Then I run an ajax request with jquery, which either sends the textarea content to update it, or receives alternative html content to dynamically populate it (in my case, the text field is used for multilingual translation).

The problem is that I cannot set the html content containing the html tags of the table () through this ajax request. It always fails. No problem with other tags. Previously, a table was created within the same text field.

The method I use to add content to the TinyMce text box is:

            tinyMCE.get('textarea_id').focus(); 
            tinyMCE.activeEditor.setContent('html content');

which works fine except html with table tags.

Any ideas?

thank

+3
source share
1 answer

I found: should use php function mysql_real_escape_string();any other escaping methods that I tried failed

+3
source

Source: https://habr.com/ru/post/1784412/


All Articles