Download textarea contents as a file using only Javascript (no server-side)

前端 未结 8 2325
挽巷
挽巷 2020-11-29 03:44

I am being asked to make a \"download\" button that downloads the contents of a textarea on the same page as a file, with the browser\'s \"Save As...\" dialog showing up. Co

8条回答
  •  一生所求
    2020-11-29 04:18

    Short answer: it's not posible. You have to POST it to server, and response from server can be "Content-disposition: attachment".

提交回复
热议问题