JQuery plug-in for image pasting in the browser -- pasteimg User Guide _ jquery

Source: Internet
Author: User
This article mainly introduces the jQuery plug-in for image pasting in the browser-pasteimg User Guide. If you need a friend, you can refer to pasteimg, which is a jQuery plug-in for image pasting in the browser, compatible with Chrome, Firefox, IE11, and other browsers that use these kernels, such as the famous 360 browser in China.

Pasteimg can recognize images directly copied in the browser or copied rich text. Only the content copied in the browser can be identified. Images copied in the operating system cannot be identified.

Pasteimg depends on jQuery and is easy to use. After jQuery and paste. image. js are introduced, the call method is as follows:

The Code is as follows:

// Call the pasteImage method on the dom element for listening and pasting events
// To call the pasteImage method, you need to input a callback parameter.
// Call callback once the image is found in the pasted content
// When callback is called, an array is input, containing all the images.
// This plug-in will convert the image to base64 encoding as much as possible, but it is subject to cross-origin restrictions. If the conversion is not allowed, the absolute url path of the image will be returned.
$ ("# Container"). pasteImage (function (imgs ){
// Imgs is array that contain all image, you can do something...

Plug-in: https://github.com/iyangyuan/pasteimg

If you have any questions, please feel free to contact us!

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.