Create HTML file with JavaScript

I'm looking for a way to use a JavaScript function to create a new HTML file in a local directory. Is it possible?

thank

+3
source share
3 answers

(client side) Yes, but you may need to create a new ActiveX object, so the browser should only be IE.

(server side) Just use any server-side scripting language (JS is not one).

+1
source

Just for web sanity and security. Make JS do such things intrusively. You can write a text file that someone can write virus.py on the client side.

0
source

Using javascript to create html is usually a bad idea, because javascript has not been developed for this, and there is nothing about javascript that makes it well suited for this task. You generate much better html with a server language like php, which is commonly used to create html.

0
source

Source: https://habr.com/ru/post/1767301/


All Articles