Save String on HTML5

Monkey Forums/Monkey Code/Save String on HTML5

Earok(Posted 2011) [#1]
Not sure if this'll be useful to anyone, but here's a basic way to save/download a string on the HTML5 target. (Note this only works on some browsers, like Chrome, and you can't set the download file name).

savestring.js
function SaveString(content){
	uriContent = "data:application/octet-stream," + encodeURIComponent(content);
	window.open(uriContent,"Download File");
}


savestring.monkey
Import "savestring.js"
Extern
Function SaveString(content:String)