i want to create a text file from a string. currently i am using a function which takes an array and makes it into a string then using that string i want to create a local t
I suggest you use a hidden iframe instead of window.open to make it "a cleaner method"
and I believe it's text/octet-stream and not text/json to force the download. And as far as I know, you can't set the file name this way.
However, Chrome (18+ I think) has a download attribute for its tags which you can specify the name of the file along with using blob: for the url.