Ueditor, the Rich text box used in the project, the function is very powerful, I only use a little bit.
The example that comes with it is also quite full.
I'll stick to the part I'm using.
First introduce
<script src= "~/content/component/ueditor/ueditor.config.js" type= "Text/javascript" charset= "Utf-8" ></ Script><script src= "~/content/component/ueditor/ueditor.all.js" type= "Text/javascript" charset= "Utf-8" > </script><script src= "~/content/component/ueditor/lang/zh-cn/zh-cn.js" type= "Text/javascript" charset= " Utf-8 "></script>
Is there a last one that doesn't matter, config can match
Note that you modify the Xxxxurlprefix series field inside the Ueditor/net/config.json, which is the path to save other things such as the picture you pasted in the text.
Next page
<id= "Editor1" type= "Text/plain" style= "width : 746px;height:500px; " > </ Script >
You can just throw this in.
Finally, some script
Window. Ueditor_home_url = "~/content/component/ueditor"; var ue = Ue.geteditor (' editor1 ');
I used two methods, a ue.setcontent ("") a ue.getcontent ()
There is an escape problem, so the set is used @html.raw.
Get the time with the innerHTML, specifically this
function HTMLEncode (HTML) { var temp = document.createelement ("div"); null) ? (temp.textcontent = html): (Temp.innertext = html); var output = temp.innerhtml; NULL ; return output; }
The content of the parameter is get, which is dropped to the background and then saved to db with Server.htmldecode ("")
Complete
Baidu Editor Ueditor