How to use filesaver.js

后端 未结 6 622
南方客
南方客 2020-12-03 07:16

In the latest filesaver documentation, an example is given for how to use filesaver.js in conjunction with blobbuilder.js:

var bb = new BlobBuilder();
bb.app         


        
6条回答
  •  一整个雨季
    2020-12-03 08:11

    https://github.com/koffsyrup/FileSaver.js#examples

    Saving text(All Browsers)

    saveTextAs("Hi,This,is,a,CSV,File", "test.csv");
    saveTextAs("
    Hello, world!
    ", "test.html");

    Saving text(HTML 5)

    var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
    saveAs(blob, "hello world.txt");
    

提交回复
热议问题