Reputation: 13
It may not be a good question, but is it possible to transfer local values from a user to a public text file using JS?
For example, I want to write the IP value of a user ( var IP = ... ) to a text file (www.blabla.com/iplist.txt ).
Upvotes: 0
Views: 56
Reputation: 1074999
With only JavaScript? Yes. With only browser-based JavaScript and nothing else? No. :-)
You need
A place that stores the file so that when people go to look at it, they can get it (e.g., a server of some kind), and
Some means of modifying the file that that server provides when people go to it, which you can't do from browser-hosted JavaScript
You could use a Node.js-based server (for instance), or some cloud provider where you don't care what the server tech is, but you'll need a server.
Upvotes: 1