Allows the editor to support js Code for word copy and pasting and screenshots, and pasting js
Chrome has many user-friendly APIs, such as drag and drop, which can be converted into base64;
For example, zhihu can directly paste an image in the reply above, so you do not need to manually click the image upload button, select an image, and confirm the upload. zhihu reference address: Open
Let the editor support the copy and paste of word, in which the image will be converted to base64 encoding. If the static page is opened remotely, the image will not be pasted when the word document is pasted, because the remote address cannot access the absolute path of the local disk, if the following code is saved as a static interface, all the images in word can be seen and converted to base64 encoding;
The Editor supports screen capture pasting;
Let the editor support direct drag and drop of images. You can drag images directly to add them. The functions are more powerful and the images are base64 encoded;
In use, the new Edit () parameter is an editable element, such as the div or iframe element with the contenteditable attribute:
<Html>
Many online editors have a single support for images, and may consider IE6, IE7, ff, chrome, and various compatibility issues;
This solution is suitable for chrome-based browsers. FF compatibility is not processed, because all the image data is based on base64, and the image is not uploaded, and the image is converted into a string, however, this disadvantage is that the data submitted each time is relatively large;
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.