Creating download prompt using purely javascript

前端 未结 4 1395
梦谈多话
梦谈多话 2020-12-21 12:21

I have some text data (say var a = \'Hello World From Javascript\';)in javascript variable in current window. I want to do the following through javascript-

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-21 13:19

    No, Content-Disposition is a response header, it has to come from the server. I think you could do it with Flash but I wouldn't recommend it.

提交回复
热议问题