jQuery Mobile artEditor rich text editor
- 2020-12-05 17:04:51
- OfStack
There are few rich text editors on mobile phones because typing is slow and not suitable for long articles. artEditor is a mobile rich text editor based on jQuery, which supports image insertion and other functions.
Plug-in address: https: / / github com baixuexiyang/artEditor star or fork welcome.
demo
Reference:
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="artEditor.min.js"></script>
Parameters:
imgTar
Picture upload button
limitSize
Maximum image limit, default 3 megabytes
showServer
Displays the image returned from the server. The default is to display the image of the local resource
uploadUrl
Picture upload road jin
data
Upload picture other parameters
uploadField
Upload picture field
placeholader
Rich text editor holder
validHtml
When pasting, remove the illegal html tag
uploadSuccess
Image upload callback successful
uploadError
Image upload failed to call back
demo:
html:
<div id="content">
</div>
js:
$('#content').artEditor({
imgTar: '#imageUpload',
limitSize: 5, // mega
showServer: false,
uploadUrl: '',
data: {},
uploadField: 'image',
placeholader: '<p> Please enter the body of the article </p>',
validHtml: ["br"],
uploadSuccess: function(res) {
// return img url
return res.path;
},
uploadError: function(res) {
// something error
console.log(res);
}
});
The above content introduces jQuery mobile terminal artEditor rich text editor related knowledge, hope you like.