Created
March 20, 2020 09:48
-
-
Save Osmiogrzesznik/6960284f9e9d1f7070aca1e938849c54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function saveText(text, filename) { | |
var a = document.createElement('a'); | |
a.setAttribute('href', 'data:text/plain;charset=utf-u,' + encodeURIComponent(text)); | |
a.setAttribute('download', filename); | |
a.click(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment