Allows the editor to support js Code for word copy and pasting and screenshots, and pasting js

Source: Internet
Author: User

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.

Related Article

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: info-contact@alibabacloud.com 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.