Click here to Skip to main content
15,908,020 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, friends!
How can I create a HTML file on the client's side using javascript?
There is a value of document.documentElement.innerHTML that represents the whole content of the webpage on the client's side, so how can I save the document.documentElement.innerHTML value as a HTML file via JS?
Thank you in advance.
Posted
Comments
Thanks7872 5-Jun-15 6:38am    
What have you tried?
Dzianis Igaravich Leanenka 5-Jun-15 10:08am    
I have no idea about the client's side but it seems to me that a request to the server and then processing of the response is the only way... at least on my mind

not sure if that's what you want but try this :
https://github.com/eligrey/FileSaver.js[^]
here's a demo :
http://eligrey.com/demos/FileSaver.js/[^]
 
Share this answer
 
You can't create files on the client file system, it would be a massive security risk.
 
Share this answer
 
Comments
Dzianis Igaravich Leanenka 5-Jun-15 10:10am    
Pity... But it seems to be so, thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900