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

jQuery mobile artEditor rich text editor_jquery

WBOY
Release: 2016-05-16 15:20:37
Original
2711 people have browsed it

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> 
Copy after login

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> 
Copy after login

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);
}
});
Copy after login

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template