Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Clipboard API

Clipboard API

About Clipboard API

BearTail LT #1
https://atnd.org/events/68533

Bibliography
[JavaScriptによる画像のペースト]( http://koyamay.hatenablog.com/entry/2015/06/16/190313 )

Kuranari Tomohisa

August 06, 2015
Tweet

More Decks by Kuranari Tomohisa

Other Decks in Programming

Transcript

  1. ࣮૷ 1: $(document).on(“paste", function(event){ 2: var items = (event.clipboardData ||

    event.originalEvent.clipboardData).items; 3: var blob = items[0].getAsFile(); 4: var reader = new FileReader(); 5: reader.onload = function(event){ 6: $("#pastedImage").attr("src", event.target.result); 7: }; 8: reader.readAsDataURL(blob); 9: }); IUUQLPZBNBZIBUFOBCMPHDPNFOUSZ