Theodor Chiriac
Theodor Chiriac

Reputation: 13

Is it possible to transfer information through js?

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

Answers (2)

Theodor Chiriac
Theodor Chiriac

Reputation: 13

Thank you, guys! I will use PHP for that.

Upvotes: 0

T.J. Crowder
T.J. Crowder

Reputation: 1074999

With only JavaScript? Yes. With only browser-based JavaScript and nothing else? No. :-)

You need

  1. 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

  2. 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

Related Questions