javascript code to save a txt file

后端 未结 6 1114
走了就别回头了
走了就别回头了 2021-01-06 12:50

can any body tell me how i create a .txt file using javascript which is browser compatable too.

and after creating the file it gives the save as diaglog box so that

6条回答
  •  孤街浪徒
    2021-01-06 13:42

    You can't do this, for hopefully obvious security reasons. JavaScript has no access to the file system...in IE it's not JavaScript, but ActiveX doing this...it just has a JavaScript API exposed.

    The problem isn't that Firefox doesn't do this...it's that IE ever allowed it :)

    In this post In Firefox, Write to a File using Javascript?

提交回复
热议问题