Pasteimg is a jquery plugin that allows you to paste images in your browser, compatible with Chrome, Firefox, IE11, and other browsers that use these kernels, such as the nationally renowned 360 browser.
Pasteimg can identify images that are copied directly from the browser, as well as images in the rich text that you copy. Only the content copied in the browser can be identified, and the images copied in the operating system are not recognized.
PASTEIMG relies on jquery and is easy to use, after introducing jquery and Paste.image.js, it is called as follows:
1 //call the Pasteimage method on a DOM element that needs to listen for paste events2 //calling the Pasteimage method requires passing in a callback parameter3 //Once a picture is found in the pasted content, it is called callback4 //when callback is called, an array is passed in, containing all the pictures5 //The plugin will convert the image to Base64 encoding as much as possible, but is subject to cross-domain restrictions and, if not converted, will return the absolute URL path of the picture6$ ("#container"). Pasteimage (function(IMGs) {7 //IMGs is an array that contain all image and you can do something ...8});
View on GitHub
Have questions welcome feedback!
Paste images in pasteimg browser jquery plugin