Baidu Editor Ueditor

Source: Internet
Author: User

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 ("")


Baidu Editor Ueditor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.