简体   繁体   中英

TinyMCE not loading HTML dymanically from Ajax call

I am using Ajax to load content dynamically into my TinyMCE Editor which is setup on page load, a user will click a button to load in content (HTML) and then I use:

var notes = response["notes"];
tinyMCE.activeEditor.setContent(notes);

To load in the raw HTML which has been filtered server side, all content is filtered through HTML Purifier setting which tags I want to allow.

This is what I get in the editor: 在此处输入图片说明

Now I know its not the server sides fault because I tried outputting the notes directly and the HTML renders on page load, but when it is past using Ajax it does that?

Upon receiving the Ajax response I do run it through response = JSON.parse(response); as the response is an array, sure that should not cause any problems?

If I do an alert on the response right away, before doing anything with the Ajax response I get this: 在此处输入图片说明

As you can see in the notes element, the HTML is being filtered by something? Is it chrome?, it does this in FF as well?

我的错,数据库输入首先被过滤。

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