Home >Web Front-end >JS Tutorial >jQuery mobile artEditor rich text editor_jquery

jQuery mobile artEditor rich text editor_jquery

WBOY
WBOYOriginal
2016-05-16 15:20:372707browse

Since typing on mobile phones is slow and not suitable for long articles, there are very few rich text editors on mobile phones. artEditor is a mobile rich text editor based on jQuery, which supports inserting images and will improve other functions in the future.

Plug-in address: https://github.com/baixuexiyang/artEditor Welcome to star or fork.

demo

Quote:

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> 
<script src="artEditor.min.js"></script> 

Parameters:

imgTar

Image upload button

limitSize

Maximum image limit, default 3 MB

showServer

Display images returned from the server. The default is to display images from local resources

uploadUrl

Picture upload Lu Jin

data

Other parameters for uploading images

uploadField

Upload image field

placeholader

Rich text editor holder

validHtml

When pasting, remove illegal html tags

uploadSuccess

Callback on successful image upload

uploadError

Callback for image upload failure

demo:

html:

<div id="content">
</div> 

js:

$('#content').artEditor({
imgTar: '#imageUpload',
limitSize: 5, // 兆
showServer: false,
uploadUrl: '',
data: {},
uploadField: 'image',
placeholader: '<p>请输入文章正文内容</p>',
validHtml: ["br"],
uploadSuccess: function(res) {
// return img url
return res.path;
},
uploadError: function(res) {
// something error
console.log(res);
}
});

The above content introduces you to the jQuery mobile artEditor rich text editor. I hope you like it.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn