20
2022-03-04 11:09:33 20阅读 0喜欢
canvas.toBlob(function(blob) {
  // blob ready, download it
  let link = document.createElement('a');
  link.download = 'example';

  link.href = URL.createObjectURL(blob);
  link.click();

  // delete the internal blob reference, to let the browser clear memory from it
  URL.revokeObjectURL(link.href);
}, 'image/jpg');
33
2022-03-04 10:29:11 33阅读 0喜欢
<a download="hello.txt" href='#' id="link">Download</a>

<script>
   let blob = new Blob(["Hello, world!"], {type: 'text/plain'}); 
   link.href = URL.createObjectURL(blob);
</script>
896访问人次
Camila Waz 2022-03-04 13:37:21
75
68
2021-12-13 15:49:59 68阅读 0喜欢
let dom = document.querySelector('textarea')
    dom.onkeydown = function(e){
        console.log(e.key)
        console.log(e.code)
        console.log(e.keyCode)

    if(e.keyCode == 13){
        e.returnValue = false
        console.log('禁用enter事件')
    }
}
2021-12-09 09:57:54 68阅读 0喜欢
85
2021-06-15 17:14:53 85阅读 0喜欢
<iframe id="pdf" name="pdf" 
      src="static/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf" 
      style="width:100%; height:500px">
</iframe>