Using Baidu's UEditor, the content code of textarea cannot be obtained using jquery on the front end: & lt; textarea & nbsp; name = "filecontent" & nbsp; id = "filecontent" & nbsp; & gt; & amp; nbsp; & lt;/tex using Baidu's UEditor, the content of textarea cannot be obtained using jquery at the front end.
The code is as follows:
var editor = new UE.ui.Editor();
editor.render("filecontent");
$('#insert_file').click(function(){
var filecontent = $('#filecontent').val();
alert(filecontent);
});
《script》
------ Solution --------------------
He has a demo. There are a lot of buttons in the demo that can be clicked to get various content...
Then you can simply use his method.
------ Solution --------------------
Get the editor content
Editor. getContent ()
Although filecontent identifies textarea
But the actual editor is in an ifarme
------ Solution --------------------
Reference:
Reference: get the editor content
Editor. getContent ()
Although filecontent identifies textarea
But the actual editor is in an ifarme
Thank you for solving the problem. but if you need to modify the old article, how should we re-put the data into the editor? Because I use ajax to retrieve data, I don't know how to re-add the data to the editor, because it is always unsuccessful ......
You need to see if JavaScript is correct and the content needs to be escaped.
------ Solution --------------------
Editor. setContent (content to be inserted)
Reference:
Reference: get the editor content
Editor. getContent ()
Although filecontent identifies textarea
But the actual editor is in an ifarme
Thank you for solving the problem. but if you need to modify the old article, how should we re-put the data into the editor? Because I use ajax to retrieve data, I don't know how to re-add the data to the editor, because it is always unsuccessful ......