1 | ;
|
2 |
|
3 | var n = require('../element/create');
|
4 |
|
5 | module.exports = function(filename, dataUrl) {
|
6 |
|
7 | var link = n("a", {
|
8 | download : filename,
|
9 | target : "_blank",
|
10 | href : dataUrl});
|
11 |
|
12 | document.body.appendChild(link);
|
13 | link.click();
|
14 |
|
15 | // Cleanup the DOM
|
16 | document.body.removeChild(link);
|
17 | };
|